Don’t use this kind of code. It’s highly inefficient. Use mysqli_fetch_assoc()
instead:
while($row = mysqli_fetch_assoc($result)) {
$id = $row['ID'];
$name = $row['name'];
etc..
}
One SINGLE database operation, rather than the 3+ you’re trying to do.
More Related Contents:
- Mysql No connection could be made because the target machine actively refused it
- mysqli – fetch_Array error call to a member function fetch_array() on a non-object mysqli [duplicate]
- Mysqli multiple row insert, simple multi insert query [duplicate]
- How to make mysqli connect function?
- Gather column name of a table from database [closed]
- I am seeing this error on submitting form Error: query was empty [closed]
- inserting information and image in php and mysql
- mysqli or die, does it have to die?
- MySQL vs MySQLi when using PHP [closed]
- How to get count of rows in MySQL table using PHP?
- Correct way to use LIKE ‘%{$var}%’ with prepared statements?
- Show values from a MySQL database table inside a HTML table on a webpage [duplicate]
- How can I store and retrieve images from a MySQL database using PHP?
- How can I enable the MySQLi extension in PHP 7?
- mysqli_stmt::bind_param(): Number of elements in type definition string doesn’t match number of bind variables
- How to store file name in database, with other info while uploading image to server using PHP?
- Mechanisms for tracking DB schema changes [closed]
- Advantages Of MySQLi over MySQL [closed]
- check if the query results empty row mysqli [duplicate]
- Is mysql_real_escape_string() necessary when using prepared statements?
- Updating from MYSQL to MYSQLI [duplicate]
- PHP + MySql + Stored Procedures, how do I get access an “out” value?
- PHP – Secure member-only pages with a login system
- How to prepare statement for update query? [duplicate]
- php password_verify() hash and pass won’t match
- How to use mysqli_query() in PHP?
- PHP to MySQL SSL Connections
- Which is fastest in PHP- MySQL or MySQLi?
- Auto Increment skipping numbers?
- How to get last inserted id from table MySQL [duplicate]