Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have problem with mysql_num_rows() function. I've checked query (it has proper syntax and I'm getting the result in sql) and connection to database and everything seems to be able to work.

// 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 '<p>Query wasn't found.</p>';
    exit;
}
if (!$num = mysql_num_rows($result)) {   // < the problem
    echo 'error';
}
if ($num == 0) {
    echo '<p>Insert proper email address.</p>';
}
else
{
    $_SESSION['crazyfotoApp']['token'] = $order_number;
    $_SESSION['crazyfotoApp']['multiformat'] = 1;
    header('Location: http://www.my.page.pl/zamow-odbitki.php?u=1');
}

I got this result:

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.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
418 views
Welcome To Ask or Share your Answers For Others

1 Answer

try mysqli_num_rows instead of mysql_num_rows


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...