comparing query result to variable [SOLVED]
Posted: Tue Sep 18, 2007 5:25 am
I'm having trouble retrieving the result of a query:
$a= "SELECT textfield FROM table WHERE key = $variable";
$b= mysql_query($a) or die("Query failed: " . mysql_error() . "$a<br>");
$c= mysql_fetch_array($b);
if ($c != $textfield){et cetra}
My if statement isn't working- when i printed the result of $c to debug, the result was "Array". there should only be one result, since field "key" is a key.
$a= "SELECT textfield FROM table WHERE key = $variable";
$b= mysql_query($a) or die("Query failed: " . mysql_error() . "$a<br>");
$c= mysql_fetch_array($b);
if ($c != $textfield){et cetra}
My if statement isn't working- when i printed the result of $c to debug, the result was "Array". there should only be one result, since field "key" is a key.