-5

hi guys the query only return one rows even i have 12 rows. Please help

$connection = mysqli_connect("localhost","root","","database");
$qry="SELECT COUNT(*) as count FROM table";
$result=mysqli_query($connection, $qry);

1 Answers1

-2

As Devon mentioned, COUNT is an aggregate function, so it will only return 1 row. If you want to retrieve all 12 rows, do:

SELECT * FROM table;
Gordan Lin
  • 27
  • 1
  • 6