Re: Mystery variable query?
| From: | CC Zona | Date: | Thu, 03 May 2001 17:46:46 +0000 |
| Subject: | Re: Mystery variable query? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9105@lists.php.net to get a copy of this message | ||
In article <9crr9l$4c4$1@toye.p.sourceforge.net>,
martinh@ureach.com ("martin helie") wrote:
> assuming:
>
> $var="1234"; (type does not seem to matter)
>
> this query returns no error, but no result either:
>
> mysql("database","SELECT * FROM table WHERE id='$var'");
When you call mysql_query is it perhaps from inside a function, where
variable $var has not been passed or made global?
(BTW, whenever you experience problems with a query, it's a good idea to
echo the query string to the browser. Often, this simple step makes it
very clear where the problem lies. Using mysql_error() and $php_errormsg
on a query failure also can give you very useful information.)
--
CC