jrws Posted September 8, 2008 Share Posted September 8, 2008 Hey I was wondering how to do this, I know how to do too mysql selects: SELECT username AND password FROM user WHERE username='John' AND password = 'test123'; But how can I do it for three or more arguments? For example, this is the code I want, but it doesn't work: SELECT username AND password AND u_LV FROM user WHERE username ='$username' AND password = '$password' AND u_lv BETWEEN 1 AND 6; I don't get any errors but the code does not function as it should (Login a user) Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 8, 2008 Share Posted September 8, 2008 When selecting different columns, separate with a comma. SELECT username, password, u_LV FROM user WHERE username='$username' AND password='$password' AND u_LV BETWEEN 1 AND 6 And to clarify, obtain errors like so: $query = mysql_query("the query") or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
jrws Posted September 8, 2008 Author Share Posted September 8, 2008 Thanks I will try it, if it works thank you, if it doesn't well then I will have to find the problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.