RE: [PHP-DB] mysql_num_rows
| From: | Ford, Mike [LSS] | Date: | Tue, 08 Jan 2002 14:16:00 +0000 |
| Subject: | RE: [PHP-DB] mysql_num_rows | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15531@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: matt stewart [mailto:matt@netvirtua.com]
> Sent: 08 January 2002 14:10
>
> don't know if this makes a difference, but i've always used
> WHERE bookid =
> '$bookid'"; - single quote round the $bookid variable - not
> sure if that's
> the problem, or if it's just good practice?
Depends on whether $bookid is a string or a number. If your id values are always numeric,
there's really no point in quoting them in the query. On the other hand, if they can be
strings it's pretty vital to quote them!!
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211