Link to home
Start Free TrialLog in
Avatar of stormist
stormist

asked on

MySQL syntax problem, can anyone correct?

$sql2 = "SELECT numberforsession FROM sessions WHERE userone = '$sessions_waiting[1]' AND where usertwo = '$usernumber' LIMIT 1";

result:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where usertwo = '1' LIMIT 1' at line 1
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Zyloch,

Although if usertwo and user1 are a number type, you also don't need the single quotes surrouding them.

Ted
Avatar of stormist
stormist

ASKER

Thanks Ted!