gary_rip Posted October 26, 2009 Share Posted October 26, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/179099-multiple-php-multidimensional-array-into-mysql/ Share on other sites More sharing options...
mikesta707 Posted October 26, 2009 Share Posted October 26, 2009 just surround your array entries with {} inside the query. IE {$array[0][$i]} Quote Link to comment https://forums.phpfreaks.com/topic/179099-multiple-php-multidimensional-array-into-mysql/#findComment-944938 Share on other sites More sharing options...
gary_rip Posted October 26, 2009 Author Share Posted October 26, 2009 just surround your array entries with {} inside the query. IE {$array[0][$i]} So simple! Thanks - you have made me very happy! Quote Link to comment https://forums.phpfreaks.com/topic/179099-multiple-php-multidimensional-array-into-mysql/#findComment-944958 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.