I just want to count the number of rows in a table that already created in a database using php. I used mysqli(). I need the number of rows in the table as the output.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
In fact it's a common question you can find the answer anywhere.
Like, http://php.net/manual/en/mysqli-result.num-rows.php
You could separate this problem in to two
If you dont want to use
COUNT
inSQL
, you can just select all rows(SELECT id FROM table)
and then just use PHPcount()
.Try simple query like:
mysqli_num_rows should do the trick if you want to count the rows in php.
also you simply do this
EDIT: