Warning: mysql_result(): supplied argument is not a valid MySQL result resource in
Hi can someone explain why I'm receiving this error? Warning: mysql_result(): supplied argum开发者_JAVA技巧ent is not a valid MySQL result resource in
if (mysql_result(mysql_query("SELECT count(*) FROM load_test WHERE batch_id=UCASE('".$batchid."')
AND word='".$data[2]."',
type='".$data[3]."',
language = '".$data[4]."',
rgender = '".$data[5]."'
"), 0) == 0) {
Hey! You're missing AND
between conditions! Don't use commas!
try this:
$query = "SELECT count(*) FROM load_test
WHERE batch_id=UCASE('".$batchid."')
AND word='".$data[2]."'
AND type='".$data[3]."'
AND language = '".$data[4]."'
AND rgender = '".$data[5]."'";
$result = mysql_query($query) or die(mysql_error());
In this way you'll can catch the mysql error you are getting when you execute the query.
Solved the problem was the commas i had at the end.
精彩评论