I've been working on a simple membership script for my site, but I keep having 2 errors in the login script. I've looked over the trouble spots 5 million times, it seems, but I can't pin point the problem. Can anyone help me?
Here's the code:
// Match Row in Database
$qChk = "select name from membership where name=='$name' and password=='$password' and (status=='Y' || status=='A' || status=='O' || status=='R') ";
$rsChk = mysql_query($qChk);
$rowCount = mysql_num_rows($rsChk) or die(mysql_error()); // how many rows returned from our query
And the Errors:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\chibi\Membership\login.php on line 28
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '=='Cookie_Monster' and password=='xxxx' and (status=='Y' || s
I got most the scrpit from a toutorial, but I added the multiple status checks, and I honestly wasn't sure if that would work, but that doesn't seem to be the problem.EDIT: Umm... ignore this post... it's not letting me delete it though... sorry.
Here's the code:
// Match Row in Database
$qChk = "select name from membership where name=='$name' and password=='$password' and (status=='Y' || status=='A' || status=='O' || status=='R') ";
$rsChk = mysql_query($qChk);
$rowCount = mysql_num_rows($rsChk) or die(mysql_error()); // how many rows returned from our query
And the Errors:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\chibi\Membership\login.php on line 28
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '=='Cookie_Monster' and password=='xxxx' and (status=='Y' || s
I got most the scrpit from a toutorial, but I added the multiple status checks, and I honestly wasn't sure if that would work, but that doesn't seem to be the problem.EDIT: Umm... ignore this post... it's not letting me delete it though... sorry.