gavicus
New Member
- Messages
- 9
- Reaction score
- 0
- Points
- 0
I'm having problems with my login script. I use the code:
$connection=mysql_connect($server,$username,$password);
$db=mysql_select_db($database,$connection);
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$q = "SELECT * FROM users WHERE username='$myusername' and password='$mypassword';";
$result = mysql_query($q);
$count = mysql_num_rows($result);
...but regardless of my form entry, I get the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gavicus/public_html/checklogin.php on line 22
...where line 22 is the call to mysql_num_rows.
Am I doing anything obviously stupid? I've wondered if x10's SQL server is having problems because everything is slow since I started yesterday, but that only makes it impossible for a newby like me to know if I'm doing something wrong.
$connection=mysql_connect($server,$username,$password);
$db=mysql_select_db($database,$connection);
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$q = "SELECT * FROM users WHERE username='$myusername' and password='$mypassword';";
$result = mysql_query($q);
$count = mysql_num_rows($result);
...but regardless of my form entry, I get the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gavicus/public_html/checklogin.php on line 22
...where line 22 is the call to mysql_num_rows.
Am I doing anything obviously stupid? I've wondered if x10's SQL server is having problems because everything is slow since I started yesterday, but that only makes it impossible for a newby like me to know if I'm doing something wrong.