storing arrays in database fields
Posted: Mon Jul 16, 2007 5:27 am
Hi,
I am having a little problem with my array and storing/retrieving it from a database field.
My array "$dbSession" stores the value of checkbox values from a form. The array works perfectly.
However, when I record the array variable into a database field named "arrSigs" (data type=text) it displays as "Array" within the database. I thought this would be normal as the value is in fact an array.
The problem arises when I try to extract and use the array from the database.
When I use the array extracted from the database as the argument in a foreach loop i get the following error: Warning: Invalid argument supplied for foreach().
Any suggestions?
I am having a little problem with my array and storing/retrieving it from a database field.
My array "$dbSession" stores the value of checkbox values from a form. The array works perfectly.
However, when I record the array variable into a database field named "arrSigs" (data type=text) it displays as "Array" within the database. I thought this would be normal as the value is in fact an array.
The problem arises when I try to extract and use the array from the database.
When I use the array extracted from the database as the argument in a foreach loop i get the following error: Warning: Invalid argument supplied for foreach().
Any suggestions?