Hi Jan > I have an array called $myarray and now I want to store it in a mysql table. > I tried to just, insert into mytable values('$id', '$myarray') but just got > Array when I run > while ($row = mysql_fetch_array ($result)) > $myarray= $row[myarray]; > echo $myarray > -- > Do I need to first make a string commaseparated or like and than insert that > string?
It depends... but don't worry, this is a fairly common assumption, so we can quickly sort it out for you. First some questions: Do you want to fit the elements of the array into successive columns across a single row of the MySQL table, or do you want each of the array elements to be stored into separate rows in the table? Are we talking about a one dimensional array, two, or more? What is the MySQL table schema? Please advise, =dn PS are you aware that there is another PHP discussion list [PHP-DB]? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php