You have to fetch that one record, it will contain the result of Count()
$result = $db->query("SELECT COUNT(*) FROM `table`");
$row = $result->fetch_row();
echo '#: ', $row[0];
More Related Contents:
- Can I mix MySQL APIs in PHP?
- How to change mysql to mysqli?
- How to prevent duplicate usernames when people register?
- Best way to INSERT many values in mysqli?
- SELECT COUNT(*) AS count – How to use this count
- How to use mysqli prepared statements?
- MySQLi prepared statements error reporting [duplicate]
- mysqli last insert id
- mysqli: can it prepare multiple queries in one statement?
- CodeIgniter: Unable to connect to your database server using the provided settings Error Message
- How to call a MySQL stored procedure from within PHP code?
- Do I have to guard against SQL injection if I used a dropdown?
- Using MySQLi from another class in PHP
- How do I display a MySQL error in PHP for a long query that depends on the user input? [duplicate]
- Call to a member function execute() on boolean in [duplicate]
- Mysql No connection could be made because the target machine actively refused it
- How to connect to MySQL database in PHP using mysqli extension?
- Unknown database error in PHP but it exists in PHPMyAdmin
- Fatal error: Uncaught exception ‘mysqli_sql_exception’ with message ‘No index used in query/prepared statement’
- Can I blindly replace all mysql_ functions with mysqli_?
- Fatal error: Call to undefined function mysqli_result()
- Using PHP to execute multiple MYSQL Queries
- Fatal error: Call to undefined method mysqli_stmt::fetch_array() [duplicate]
- How to run multiple insert query in SQL using PHP in one go?
- Strange problem with the length of the field gotten from database [duplicate]
- PHP: mysql v mysqli v pdo [closed]
- How do I ensure I caught all errors from MySQLi::multi_query?
- Cannot figure out how to run a mysqli_multi_query and use the results from the last query
- How to get a list of databases?
- Why cannot the PHP hide the error message thrown by the MySQL connection?