Hi all, i am getting Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\xampp\htdocs\demo\help.php on line 23
this error. how to overcome by this problem,
<?php
include 'database.php';
$email = $_POST;
$firstname = $_POST ;
$lastname = $_POST ;
$tphone = $_POST.$_POST.$_POST ;
$message = $_POST;
$querys = "insert into helpdesk(email_id,firstName,lastName,phone,message) values ('".$email."','".$firstname."','".$lastname."','".$tphone."','".$message."')";
$result = mysql_query($querys);
echo $result;
echo $querys;
$User="";
$check = "select * from helpdesk where email='email_id'";
if(!$check)
{
die('Could not connect: ' . mysql_error());
}
$rcheck = mysql_query($check) ;
$num = mysql_num_rows($rcheck);
$rcheck = mysql_fetch_array($rcheck);
if($num == 0) // if user not found
{
$result = mysql_query($querys);
$User = " successfull.";
} else
{
mysql_close();
$User = " Email id already exist.";
}
?>