RE: select statement with variables ???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Can someone tell me why this select is wrong please---ive 
> tried everything.
> the $cat is the tablename .
> 
> 
> $query=" SELECT title FROM $cat WHERE id='$id'";
> 
> 

Apparently, either $cat or $id is not the value you think it is.  First, I
would try changing

$result=mysql_query($query);

to read:

$result=mysql_query($query) or die(mysql_error());

This will, no doubt, lend some insight into where your error is.

JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux