Jump to content

Multiple PHP Multidimensional Array into mysql


gary_rip

Recommended Posts

Hello All,

 

Long time since my last question...

 

Each multidimensional array has 100 values. I wish to put each array into its own column and each value in to 100 different rows in the that column.

 

At the moment i am getting "Array[1]" etc... put into the mysql database.

 

My code is...

 

for ($i=0; $i<=99; $i=$i+1)
{
mysql_query("INSERT INTO tophotdeals (title, deal_link, mobile_deal_link, deal_image, description, submit_time, hot_time, poster_name, temperature)
VALUES ('$title[0][$]', '$deal_link[0][$i]', '$mobile_deal_link[0][$i]', '$deal_image[0][$i]', '$description[0][$i]', '$submit_time[0][$i]', '$hot_time[0][$i]', '$poster_name[0][$i]', '$temperature[0][$i')");
}

 

In reading about, i don't think i want to use serialize, it looks like i want to use implode, but i cant find an example with many arrays and its all getting a bit confusing.

 

I welcome any help!

 

 

Thanks

 

Gary

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.