Re: multiple inserts into a db

From: Date: Thu, 19 May 2005 06:11:37 +0000
Subject: Re: multiple inserts into a db
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-215566@lists.php.net to get a copy of this message
On Wed, May 18, 2005 9:47 pm, mayo said: > $ses_basket_items is the total number of items > $orderID = the orderID which these items are a part of > $ses_basket_id = is the itemID number Which item ID number? Cuz, like, you've got FOUR different itemID numbers. Something isn't making sense here... > for ($i=0;$i<$ses_basket_items;$i++){ > > $query = "INSERT INTO orderedItems (orderID,itemID) VALUES > ('$orderID','$ses_basket_id')"; echo $query, "<hr />\n"; You probably have an ARRAY of itemID numbers. You need to get each itemID number out of that array and get it into your query. > mysql_query($query) or die('Error, insert query failed'); > > } > > mysql_close($conn); You really do need to re-read the PHP Manual section about arrays and what they are and how they work... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#215566) next »