RE: select statement with variables ???

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

 



[snip]
> $query=" SELECT title FROM $cat WHERE id='$id'";
[/snip]

echo $query; // does it look right to you?
Alway throw an error when in question

if(!($result = mysql_query($query, $connection))){
   echo mysql_error() . "<br>\n";
   exit();
}

My bet is that you need to concatenate

$query = "SELECT title FROM " . $cat . " WHERE id = '". $id ."' ";

-- 
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