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 Link to comment https://forums.phpfreaks.com/topic/122884-solved-quick-question/ 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? Link to comment https://forums.phpfreaks.com/topic/122884-solved-quick-question/#findComment-634644 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'; } Link to comment https://forums.phpfreaks.com/topic/122884-solved-quick-question/#findComment-634648 Share on other sites More sharing options...
paulman888888 Posted September 5, 2008 Author Share Posted September 5, 2008 IT WORKS! THANKYOU Link to comment https://forums.phpfreaks.com/topic/122884-solved-quick-question/#findComment-634649 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.