Jump to content

[SOLVED] Login problem


rnintulsa

Recommended Posts

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.

 

 

 

Link to comment
Share on other sites

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 :P)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.