paulman888888 Posted September 5, 2008 Share Posted September 5, 2008 I have been trying to make a little script that will look in a MYSQL database and see if there is username and password in the same row. If there is then echo 'blah'; and if not, echo 'blah blah'; So far i have this but as you can tell its a little messy, and i dont know how to do the IF there is a 'username and password' part. $result=mysql_query("SELECT * FROM user_man WHERE name = '$username' AND password = '$password'"); or die('error'); Thankyou for all help Paul Quote Link to comment Share on other sites More sharing options...
adam291086 Posted September 5, 2008 Share Posted September 5, 2008 that appears to be fine whats the problem? Quote Link to comment Share on other sites More sharing options...
adam291086 Posted September 5, 2008 Share Posted September 5, 2008 if your unsure what to do next try $result=mysql_query("SELECT * FROM user_man WHERE name = '$username' AND password = '$password'") or die('error'); $result = mysql_num_rows($result); if($result == 1) { echo 'blah' } else { echo 'blah blah'; } Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted September 5, 2008 Author Share Posted September 5, 2008 IT WORKS! THANKYOU 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.