I have a table with 5 rows and I want to print the count of all the rows into a html div
. I tried it like this:
$sqlassets = "SELECT COUNT(*) FROM assets";
$result=mysqli_query($conn, $sqlassets);
$log=var_dump($result);
and then I tried to use this variable in HTML:
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Count of cars</div>
<div class="h5 mb-0 font-weight-bold text-gray-800"><?php print($log) ?></div>
</div>
but the result is:
object(mysqli_result)#2 (5) { ["current_field"]=> int(0) ["field_count"]=> int(1) ["lengths"]=> NULL ["num_rows"]=> int(1) ["type"]=> int(0) }