I have a lot of sql query on my php code, and all of them work well except this one.
$sql_pay = "SELECT * FROM transaccion_cobro WHERE codigo='A2131231' AND idEstadoTransaccion=2";
$query_pay=mysql_query($sql_pay,$db);
$num_pay = mysql_num_rows($query_pay);
This is the error I get:
mysql_num_rows() expects parameter 1 to be resource, boolean given
I guess that mysql_query fails and returns false. But I don't know why. If I execute that query on "MySQL Query Browser" it returns the expected values. Also, the rest of the queries are correctly executed.
Does anyone have any idea of what could be happening here?
UPDATE:
Problem solved thanks to @ICanHasCheezburger comment