I would like to know the total of numbers of columns or records entered in a table and display it on the screen.
For example, in the table I have three records or columns and I need you to give me the number 3
What I have is the following
global $connect;
$query = "SELECT count(*) as total from Asistente ";
mysqli_query($connect, $query) or die (mysqli_error($connect));
$data=mysqli_fetch_assoc($result);
echo $data['total'];
mysqli_close($connect);
error message
mysqli_fetch_assoc () expects parameter 1 to be mysqli_result, null given in