I just want to determine if someone with this "cid" is already registered. Here is the code:
//determines if user is already registered
$query = sprintf("SELECT cid from userinfo where cid='%s' LIMIT 1)
VALUES('%s')",
mysql_real_escape_string($cid, $con));
$exec = mysql_query($query, $con); //executes query
$num_rows = mysql_num_rows($exec); //determines how many rows are returned
if($num_rows == "1")
{
die("You are already registered");
}
It gives me any error of:
Warning: sprintf() [function.sprintf]: Too few arguments in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\newatc.php on line 31
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\newatc.php on line 33