mysql - PHP : How to select another column -
There are 3 columns in my table username, password and element I value value is 1. So I have created a webpage, if the user has to enter the correct username and password to see my PHP, that if element = 1 should do something which I want and changes the element to 0. But if it's 0 then PHP is nothing. My problem is that it displays white screen.
& lt ;? Php require_once ("function / func_connect.php"); Require_once ("function / func_check.php"); Need_once ("function / websend.php"); $ ObjLogin = checkPassword ($ _ POST ['user_name'], $ _ POST ['user_password'], $ Cfg ["table"] ["user"]); If ($ objLogin == incorrect) {included ("state / login_failed.html"); Go out(); } If ($ objLogin == true) / I think the problem arose here, how do I fix? Mysql_query ("select element authme WHERE user name = $ _POST ['user_name']"); "Success" echo; } Mysql_close (); ? & Gt; Thanks and sorry for my bad english.
Your original error is that you are not wrapping your string value in quotes.
mysql_query ("select element authme WHERE user name = $ _POST ['user_name']"); must be
mysql_query ("select element authme WHERE user name = '$ _POST [' user_name ']'"); But, equally important, you are open wide open. You have to fix that ASAP.
You have to turn it on so that you can see your errors instead of just getting a white screen.
FYI. See they are not maintained now? Instead, learn about it and use it or - it will help you to decide which one you choose if you choose a PDO.
Comments
Post a Comment