rnintulsa Posted July 21, 2008 Author Share Posted July 21, 2008 That's it! (I think) No more fatal errors. But now there are more problems. Maybe all my code is meant for mysql-i since it is not working now. Is that possible? Now I get this error. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /nfs/cust/4/45/65/556544/web/login_orion.php on line 21 You must be registered before you may log in. Just found out that the new host will not be upgrading our php and mysql as I thought. They are only doing it for the Windows servers. Crap. I am going to have to make this work. Any suggestions? Many thanks to you for taking the time to help. Quote Link to comment https://forums.phpfreaks.com/topic/115300-solved-login-problem/page/2/#findComment-596029 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 my bad change $num_rows = mysql_num_rows($result); to $num_rows = mysql_num_rows($results); missed the s EDIT: as a note, most people use MySQL instead of MySQLI, so any problems with after this one.. will be a useful leason (your need to learn it some time ) Quote Link to comment https://forums.phpfreaks.com/topic/115300-solved-login-problem/page/2/#findComment-596032 Share on other sites More sharing options...
MadTechie Posted July 22, 2008 Share Posted July 22, 2008 Also change this $username = $_POST['username']; $password = $_POST['password']; //@ $db = new mysqli( 'mysql.kdesigns.net', 'username', 'password', 'dbname' ); $link = mysql_connect('localhost', 'root', 'rn2846'); to //@ $db = new mysqli( 'mysql.kdesigns.net', 'username', 'password', 'dbname' ); $link = mysql_connect('localhost', 'root', 'rn2846'); $username = mysql_real_escape_string($_POST['username'], $link); $password = mysql_real_escape_string($_POST['password '], $link); note: i moved the connection above the setting on username and password using mysql_real_escape_string will protect you from SQL injections Quote Link to comment https://forums.phpfreaks.com/topic/115300-solved-login-problem/page/2/#findComment-596036 Share on other sites More sharing options...
rnintulsa Posted July 22, 2008 Author Share Posted July 22, 2008 MadTechie... You are a God! It works. Thank you so much. Thanks to all who contribute. And thanks for the extra advice MadTechie. I am learning lots of useful lessons. I need to learn the basics of php. This is my first real language to learn, besides xhtml and css. Quote Link to comment https://forums.phpfreaks.com/topic/115300-solved-login-problem/page/2/#findComment-596046 Share on other sites More sharing options...
MadTechie Posted July 22, 2008 Share Posted July 22, 2008 your welcome, can you click topic solved, also did you get the PM i sent? Quote Link to comment https://forums.phpfreaks.com/topic/115300-solved-login-problem/page/2/#findComment-596052 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.