I am working on a small project and is having some issues with looping MySQL insert. I currently have 2 database tables. I am fetching information from one to another.
table with data:
$q = "SELECT * FROM HARDWARE WHERE ID_2=".$db->qstr(20);
$rss = $db->execute($q);
$re2=$rss->GetArray();
so I am getting the array of data fine.
inserting the data only if the id is {20} Currently I have 2 rows with ID_2 = 20 but it is only inserting one row not both. here is my insert query.
$sql = "INSERT INTO PARTS SET
IN_ID =". $db->qstr($in_id).",
ER_ID =". $db->qstr( $er_id).",
ITEM =". $db->qstr( $re2[0]['ITEM'] ).",
NAME =". $db->qstr( $re2[0]['NAME'] );
it inserts the data fine, just one row not multiple rows. any suggestions?
Thanks.