jeudi 18 février 2021

Session array to string conversion issue to use it in php database query [closed]

senter image description here -->code for displaying the items from the database.

-->using a hidden button (so that for whichever product user clicks on the buttton the name is saved in session

-->session $_SESSION['n'][]so that values won't be overwritten in the same index

enter image description here Web display of the above code

enter image description here Here is the main issue: as i try to retrieve the session into a variable it gives Error :array to string conversion if i try to use the implode function it is not suitable for the database query..

Kindly,tell me is there a way i can retrieve the session values and use them in the query in a way that i won't get any erros i.e: string to array conversion

enter image description here error that i get after

$n=$_SESSION['n'];

echo $n;




Aucun commentaire:

Enregistrer un commentaire