Posts by Mauro Alexandre • 1,353 points
52 posts
-
1
votes1
answer574
viewsA: Notice: Object of class Pdostatement could not be converted to int in
Hello. Make the following change: $nRows = $con->query($sql_sb); To $nRows = $b->rowCount(); If you notice, $nRows has the same value as $b, so instead of retrieving the number of columns, you…
phpanswered Mauro Alexandre 1,353 -
2
votes2
answers2725
viewsA: How can I check if a table is empty?
You will need to make a select and check the return. This example is in PDO. $sql = DB::prepare(" SELECT COUNT(1) FROM table "); $sql->execute(); $count = ( $sql->rowCount() < 1 ? "Vazio" :…