Mysqli fetch row - Mysqli_fetch_row - PHP MySQL Display - Phptpoint.com

mysqli_fetch_row

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

/ins>

Fetch data using mysqli_fetch_row( ) function

The mysqli_fetch_row() function returns a row from a recordset as a numeric array.
mysqli_fetch_row() return a single row from the number of records available in the database.
at a time it return only the first row of the result set. if we want to retrieve all the rows of the table then we must put this function inside the while loop.

Syntax

Display the records using mysqli_fetch_row( )

In the above example first connection to the database is created after that the result provided by mysqli_query() is passed to mysqli_fetch_row() and the data of the row is displayed using print_r() function.

Retrieve all records from empInfo table using mysqli_fetch_row( ) 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_row() and row 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.

Related: mysqli fetch array

Latest Trending Technologies