我有mysql_num_rows()函数的问题.我检查了查询(它有正确的语法,我在sql中得到结果)和连接到数据库,一切似乎都能够工作.
// some code here, connecting to database and working query to db
$query = "SELECT ff_client.email FROM ff_order, ff_client WHERE ff_order.id = '$order_number' AND ff_order.client_id = ff_client.id AND ff_client.email = '$email'";
if (!$result = mysqli_query($db, $query)) {
echo '
Query wasn\'t found.
';exit;
}
if (!$num = mysql_num_rows($result)) { // < the problem
echo 'error';
}
if ($num == 0) {
echo '
Insert proper email address.
';}
else
{
$_SESSION['crazyfotoApp']['token'] = $order_number;
$_SESSION['crazyfotoApp']['multiformat'] = 1;
header('Location: http://www.my.page.pl/zamow-odbitki.php?u=1');
}
我得到了这个结果:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/sda3/www/www1.my.page.pl/recover.php on line 37
error
Insert proper email address.