hi everyone.
i am trying to use mysqli_num_rows within a php function ( i am using the function to determine whether a user was able to deactivate their account). ult.
i cannot however seem to get it to work. the result always returns the following error message:
warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\babysitter-agency.com\cms\db_fns.php on line 51
i enclose my code below
thank you for your kind attention.PHP Code:
function deactivate_account($id)
{
//the global connection.
global $dbc;
$qb = "UPDATE users
SET
live= '1'
WHERE
user_id = '$id ' ";
$rb = mysqli_query ($dbc, $qb); // Run the query.
$returnrows = mysqli_num_rows( $rb );
if ( $returnrows == 1)
{
return $returnrows;
}
else
return '';
}
$account = deactivate_account(18);
echo "$account";
warm regards
Andreea



Reply With Quote



Bookmarks