Hi am using Aura sql to perform querying. What is the equivalent function for mysql_num_rows in aura sql.
I have to check:
if(mysql_num_rows($query)==1)
// do something
else
// do something
For this i need the equivalent function in Aura.Sql.
Aura.Sql uses PDO internally. The equivalent to mysql_num_rows http://www.php.net/manual/en/function.mysql-num-rows.php points to http://www.php.net/manual/en/pdostatement.rowcount.php .
If you are using v1 of aura insert, update, delete etc always returns the number of affected rows. See https://github.com/auraphp/Aura.Sql/blob/develop/src/Aura/Sql/Connection/AbstractConnection.php#L953 .
If you are using a select statement you could make use of the count() or you can use fetchOne https://github.com/auraphp/Aura.Sql/tree/develop#fetching-results .
So in this case I will say
Let me know if that helps!