php - foreach through a session variable -


I would like to repeat on each object in my session variable 'item' is a type of item which is a book that I The book is designed to store information. I have made a count ($ _ session ['item']) which gives 1 so I thought it should be repeated at least once but no luck thank you

foreach ($ _SESSION ['item'] as $ item) {echo test; $ Sql ​​= 'SELECT * item with WHERE item_ID ='. $ Item- & gt; Get_Item_ID; Var_dump ($ sql); }

Why are you archiving objects in a session variable?

The object must be able to serialize and deorize, which you can store in a cookie.

I think $ _SESSION can only store strings and arrays.

>

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -