I am just writing a simple query and I am getting an error with the result variable.
here is the code
<?php $result = mysql_query( "SELECT * FROM $TABLE WHERE $field = $valur" ); $num_rows = mysql_num_rows( $result ); ?> If says "Warning: Supplied argument is not a valid mysql result resourcs in row .
Anyone see whats wrong? Thanks. Adam
thats because the query must be failing.
check whether the $result is true or false. also you need ' around the value. e.g. '$valur'
good luck, Daarius...
i am also getting this god forsaken message.
Ive tried several different queries to different tables and still no luck , anybody got any further thoughts on this ?
i am using the same code and database that works perfectly on another computer .
I figured out what it was. Try testing the result resource with:
$result = mysql_query(query); if (! $result) { die("Invalid Query"); } //continue
If you have access to a mysql command promt try the query there and if it doesn't work you may need to reinstall Php.
Its wierd , the SQL query works perfectly . guess i'll have to reinstall .
Any other thoughts ?