Jump to content

Merge 3 arrays to insert in one row in db


Recommended Posts

Well if you can guarantee that they will always be in the right order relative to each other, and be the same size.

 

<?php
for($i = 0; $i<sizeof($array1); $i++) {

$sql = 'INSERT INTO tableName (column1, column2, column3) VALUES (' . $array1[$i] . ',' . $array2[$i] . ',' . $array3[$i] . ')';
mysql_query($sql);
}


?>

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.