phpretard Posted October 29, 2010 Share Posted October 29, 2010 I need to some how pull comma separated images $data[23] from this $data array and then put them into there own array so I can insert them into separate rows in a database. This is the provided array: $data[0] => VIN $data[1] => StockNumber ...(all the other number here) $data[23] => Image_URLs (comma seperated) $data[24] => Equipment // I need something like this (obviously doesn't work?!@#) $delimiter = ","; $img = explode($delimiter, $data[23]); foreach($img as $pic){ $sqlPic = "insert into class_prodimages (pid image rank) values('".$LastId['id']."', '$pic', '".rand(1,20)."')"; } Any help here? Quote Link to comment Share on other sites More sharing options...
mikecampbell Posted October 29, 2010 Share Posted October 29, 2010 Where you have insert into class_prodimages (pid image rank) .... that should be insert into class_prodimages (pid, image, rank) .... Quote Link to comment Share on other sites More sharing options...
Yucky Posted October 30, 2010 Share Posted October 30, 2010 $new = explode(",", $data[23]); Quote Link to comment Share on other sites More sharing options...
phpretard Posted October 30, 2010 Author Share Posted October 30, 2010 That was easy...Thanks!!! Quote Link to comment 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.