Good evening everyone! I have a loop that writes data to the database through while () ($ id is known earlier)
$i = 1; while (isset($_POST['account-'.$i]) && isset($_POST['brokerage-id-'.$i])) { $account = $_POST['account-'.$i.'']; $brokerage = $_POST['brokerage-id-'.$i.'']; echo $_POST['account-'.$i.'']; echo $_POST['brokerage-id-'.$i.'']; echo $id; $res = $db->query("INSERT INTO `accounts` SET `id_user` = '".$id."', `account` = '".$account."', `brokerage` = '".$brokerage."'") or exit(mysql_error()); $i++; } echo displays everything correctly, but only one record gets into the database (the very first one), but the following ones do not, only echo shows that iterations pass and displays the values of all iterations
$id? - PinkTux