I’ve wrote a select from statement for my gaming system but it keeps returning no rows.
Could somebody spot my error?
This is my code. It’s meant to redirect if the field returns differnet to one results, but I have one in the database with the service_id of 1 and user_id of 2.
$service_sql=mysql_query("SELECT * FROM user_services WHERE service_id='1' AND 'user_id'='2'");
if(mysql_num_rows($service_sql)!=='1'){
echo mysql_num_rows($service_sql);
echo "error";
My instant reaction is that this needs changing
to
Also, is user_id a number type or a char type ? if it’s a number then change ‘1’ to 1.