Jump to content


Photo

reading/writing php array to mysql


  • Please log in to reply
1 reply to this topic

#1 dpwhite

dpwhite
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 15 October 2006 - 07:47 PM

I have a table in php which I want to write out to a mysql table.
then I want to read it back into the array.
I want to either loop thruough the array and write it, or write the
entire array.

How do I do it.

Thanks



#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 15 October 2006 - 08:35 PM

use a foreach loop to iterate through the array and use a mysql insert statement to write each record.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users