Reply to Re: [PHP] multiple inserts into a db

Your name:

Reply:


Posted by "Richard Lynch" on 11/26/97 11:16

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация