You are here: Re: [PHP] Simple Problem « PHP « IT news, forums, messages
Re: [PHP] Simple Problem

Posted by Duncan Hill on 04/12/05 18:31

On Tuesday 12 April 2005 16:24, PartyPosters typed:
> $sql="SELECT products.productID, products.title, products.number_per_box,
> products.stock_level, products.image, users.username, users.email,
> users.userID FROM users, products  WHERE products.userID = $userID";
> $mysql_result=mysql_query($sql,$connection);
> $num_rows=mysql_num_rows($mysql_result);

You don't specify how the query should join the tables users and products.

WHERE products.userID = users.userID and users.userID = $userID

I'll assume you do validation on the userID ahead of time to ensure that it's
the right format.

--
My mind not only wanders, it sometimes leaves completely.

 

Navigation:

[Reply to this 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

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