I try to update to mysqli some code that was mysql. How can I say now: if there is something selected …
php.net says that mysql_num_rows is deprecated and give other alternatives to this function that seems more complicated: http://php.net/manual/en/function.mysql-num-rows.php
After trying a lot of things, I discover that if I just add a “i”, this works. Is it correct or there is a better solution?. If it is so easy, why php.net does not even mention it? :
$result = mysqli_query($con, "SELECT * FROM client");
if (mysqli_num_rows($result)>0) {
// do something
}
After asking to many people it seems that this is correct. It seems that php.net accept mysqli_num_rows: http://php.net/manual/es/mysqli-result.num-rows.php
I still don’t understand why they does not say that mysqli_num_rows is correct when you look at mysql_num_rows. : http://php.net/manual/en/function.mysql-num-rows.php . They send you to other solutions This can make a lot of confusions.
Anyway, I think, this works and it is the updated mysqli: