mikk809h Posted February 18, 2013 Share Posted February 18, 2013 Hello. im new to the forum, and i started this topic because im having a lot of trouble with my admin-login system.. what the finale code should do: when i enter correct information, prints SUCCES (without errors xD) or else print FAILURE! but when i logged in with correct information i got following errors: Succes!Succes! PHP Error Message Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a1043884/public_html/admin/class.login.php on line 97 Free Web Hosting Query Fail! PHP Error Message Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a1043884/public_html/admin/class.login.php on line 105 Free Web Hosting PHP Error Message Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a1043884/public_html/admin/class.login.php on line 113 Free Web Hosting Errors Invalid Username/Password the code would be posted on pastebin. But please help me! Thanks in Advance -mikk809h Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/ Share on other sites More sharing options...
AyKay47 Posted February 18, 2013 Share Posted February 18, 2013 1. "Login" isn't really an object it's a procedure and shouldn't be made into a class. Creating a User class and creating login method(s) for that class would be a better OOP solution. 2. In the call to mysql_query() you are using variable $connection when in fact variable $conn is what holds your mysql link. Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/#findComment-1413204 Share on other sites More sharing options...
mikk809h Posted February 18, 2013 Author Share Posted February 18, 2013 so i have to close the classes right before the functions? Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/#findComment-1413205 Share on other sites More sharing options...
mikk809h Posted February 18, 2013 Author Share Posted February 18, 2013 But now.. there is no errors, but somehow it just shows " Succes!Succes!Query Loaded! Errors " when i entered the correct information.. but there is no errors. Can someone help me fixing, that the "errors" dissappear? code thanks Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/#findComment-1413208 Share on other sites More sharing options...
AyKay47 Posted February 18, 2013 Share Posted February 18, 2013 1. "Login" isn't really an object it's a procedure and shouldn't be made into a class. Creating a User class and creating login method(s) for that class would be a better OOP solution. 2. In the call to mysql_query() you are using variable $connection when in fact variable $conn is what holds your mysql link. Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/#findComment-1413213 Share on other sites More sharing options...
mikk809h Posted February 18, 2013 Author Share Posted February 18, 2013 what do you mean with that? i followed that before. (not the class thingy, but the mysql_query()) Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/#findComment-1413217 Share on other sites More sharing options...
mikk809h Posted February 19, 2013 Author Share Posted February 19, 2013 No answer? Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/#findComment-1413295 Share on other sites More sharing options...
AyKay47 Posted February 19, 2013 Share Posted February 19, 2013 Not to be crude, but there are so many things wrong with this code that I cannot take the time at the moment to look through it all line by line. There is only one method that modifies the _errors property, i suggest looking there first and implementing proper error checking logic into your code during development. Quote Link to comment https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/#findComment-1413361 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.