You need to alias the aggregate using the as
keyword in order to call it from mysql_fetch_assoc
$result=mysql_query("SELECT count(*) as total from Students");
$data=mysql_fetch_assoc($result);
echo $data['total'];
More Related Contents:
- SELECT COUNT(*) AS count – How to use this count
- How to get count of rows in MySQL table using PHP?
- mysql count into PHP variable
- Im trying to create some temporary tables in mysql using php
- the update query just update the last row and affect other with it’s value
- How to insert images into a database using PHP [closed]
- How to change mysql to mysqli?
- php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
- mysqli: can it prepare multiple queries in one statement?
- Laravel 5 PDOException Could Not Find Driver
- Escaping MySQL wild cards
- Import CSV file directly into MySQL
- mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object
- Storing and displaying unicode string (हिन्दी) using PHP and MySQL
- 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]
- Increment value in MySQL update query
- Php – Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- Whats the easiest way to determine if a user is online? (PHP/MYSQL)
- What is the advantage of using try {} catch {} versus if {} else {}
- Javascript function post and call php script
- Trying to access array offset on value of type bool
- onbeforeprint() and onafterprint() equivalent for non IE browsers
- How to get a query error from prepare() in PDO PHP?
- Fatal error: Call to a member function query() on null
- MySQL GROUP BY and Fill Empty Rows
- mysql injection damages?
- PHP PDO how to run a multiple query request?
- how to execute mysql command DELIMITER
- PDO and MySQL ‘between’