Looped INSERT
Posted: Thu Feb 11, 2010 9:36 pm
Trying to use a "for" loop to insert into database,
$A1 = $_POST[A1];
$B1 = $_POST[B2];
$A2 = $_POST[A2];
$B2 = $_POST[B2];
$num = $_POST[number];
for ($i=0; $i<=$num; $i++) {
$res = mysqli->query("insert into table ('".$A[$i]."','".$B[$i]."')");
}
What am i doing wrong?
$A1 = $_POST[A1];
$B1 = $_POST[B2];
$A2 = $_POST[A2];
$B2 = $_POST[B2];
$num = $_POST[number];
for ($i=0; $i<=$num; $i++) {
$res = mysqli->query("insert into table ('".$A[$i]."','".$B[$i]."')");
}
What am i doing wrong?