Mysqli Fetch Array - MySQL - PHP MySQL Display - Phptpoint.com

Mysqli Fetch Array

PHP Summer Training/Internship with 2 Live Projects in Noida Fee is only 5500/-Click here to Book Your Seat.

/ins>

Display data using Mysqli Fetch Array( ) function

mysqli_fetch_array() return the rows from the number of records available in the database as an associative array or numeric array.
At a time it return only the first row as an associative array or numeric array. if we want to retrieve all the records of the table then we must put this function inside the while loop.

Syntax

Display the records using mysqli_fetch_array()

Output :

In the above example first connection to the database is created after that the result provided by mysqli_query() is passed to mysqli_fetch_array() and the data of the associative array or numeric array is displayed .

Display all records from empInfo table using mysqli_fetch_array( ) function.

Output :

Emp_idNameEmailMobile
1deveshdevesh@gmail.com9910099100
2deepakdeepak@gmail.com9210053520
3raviravi@gmail.com9810098100

In the above example first connection to the database is created after that the result provided by mysqli_query() is passed to mysqli_fetch_array() and array returned is stored in ‘r’ variable and it put in while loop to fetch all records . after that the data is displayed in tabular form.

Latest Trending Technologies