Reply to Re: [PHP] Simple Problem

Your name:

Reply:


Posted by Joseph Connolly on 04/12/05 18:56

I think what you mean/need is:

$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 = users.userID AND userID = $userID";



John Nichel wrote:

> PartyPosters wrote:
>
>> I can't figure out what I am doing wrong,
>> this sql string seems to filter out the information I want but it
>> duplicates the all info, as 'num_rows' is total of rows in the table
>> and not the correct value of the filtered information?
>>
>> $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);
>>
>>
>> this is the old sql statement which works fine - $sql="SELECT
>> productID, title, number_per_box, stock_level, image, userID FROM
>> products WHERE userID = '$userID'";
>> $mysql_result=mysql_query($sql,$connection);
>> $num_rows=mysql_num_rows($mysql_result);
>
>
> http://lists.mysql.com
>

[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

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