sessions

From: Date: Wed, 17 Sep 2003 09:23:51 +0000
Subject: sessions
Groups: php.general 
Request: Send a blank email to php-general+get-162848@lists.php.net to get a copy of this message
I have a little problem whit this script ................... $sql="INSERT INTO tranzactii (name, email) values ('".$_POST['name']."','".$_POST['email']."')"; $result=mysql_query($sql); $id_transaction=mysql_insert_id(); for ($i=0; $i < count($_SESSION['id_product']); $i++) { if ($_SESSION['nr'][$i] > 0) { $sql1="INSERT INTO sales values ('".$id_tranzactie."','".$_SESSION['id_product'][$i]."','".$_SESSION['nr'][$i]."')"; mysql_query($sql1); } } ------------------- The probem is that if i have more products only first id_product is insert into table sales. The rest id_product are inserted with 0. How can I get over it?

« previous php.general (#162848) next »