|
Posted by Michael Fesser on 12/08/06 23:19
..oO(Larry in Honolulu)
>I'm getting an error message that makes no sense to me. I have a table with a
>field named 'testkey' for a list of "keys" in the form of ABC10102. I have a
>php variable holding a specific key number.
>
>The relevant code is -
> $_testkey = 'LAL10102';
> $sql = "SELECT * FROM `pro_keys` WHERE `keynum`=`$_testkey`";
> $result=mysql_query($sql,$db_conn);
Strings in an SQL query have to be quoted (and drop the backticks):
$sql = "SELECT * FROM pro_keys WHERE keynum = '$_testkey'";
Micha
Navigation:
[Reply to this message]
|