Code: Select all
$query = "select * from accounts where email='" . mysql_real_escape_string($_POST[email]) . "'";Code: Select all
$query1 = mysql_query("select * from accounts",$con);
$dummy = mysql_num_rows($query1);
If ($dummy == 0 OR $dummy == null) { //not sure about the null thing, any enlightment?
$dummy1 = $dummy;
}
Else {
$dummy1 = $dummy + 1; // would "++" work? ?
}The first query is successfull and of course the second fails.
Code: Select all
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\verifyreg.php on line 45
Duplicate entry '1' for key 1Queries and results echoed with a new email give this:
Code: Select all
select * from accounts where email='d@d.com'
select * from accounts
Array ( )Code: Select all
select * from accounts where email='a@a.com'
select * from accounts
Array ( [0] => Array ( [MyIndex] => 1 [email] => a@a.com [pass] => 123456789 [admin] => 0 ) )Wide open to anything
Thx beforehand.
EDIT: Forgot to state the problem, even though it's written in the title xD.
If there is any way to do both queries with my way or any other way to get that particular job done.