QuestionMySQL Need help fast

Posts 1–5 of 5 · Page 1 of 1
MySQL Need help fast
im getting an error on mysql when im trying to login as admin

Code:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/xxxxx/public_html/xxxx/login.php on line 17
this is where the error starts:

Code:
		$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
		$result=mysql_query($sql);
		$count=mysql_num_rows($result);  <------------- ERROR
		if($count >= 1){
		session_register("myusername");
		session_register("mypassword");
		header("location: index.php");
		} else {
			
		}
	}
x.x I would help but its 8 am and my brain feels fried
Try to check for typos maybe ^^
Quote Originally Posted by TheTrueKing View Post
Try to check for typos maybe ^^
there are none.

EDIT: this is the error i'm getting
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''admins' WHERE username='test' and password='test'' at line 1

- - - Updated - - -

It's solved
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?