Re: Simple Problem
| From: | Duncan Hill | Date: | Tue, 12 Apr 2005 15:31:08 +0000 |
| Subject: | Re: Simple Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-212936@lists.php.net to get a copy of this message | ||
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.