display rows brought back by query php 1

display rows brought back by query php

$result = mysqli_query($sql); // execute query

// process each row returned from query
while($row = mysqli_fetch_array($result)) {
    echo $row['fieldname'];  // print the field (column name in table)
  	echo print_r($row);		 // print out the whole road
}

Here is what the above code is Doing:
1. Connect to the database
2. Create a query to select all the fields from the table
3. Execute the query
4. Loop through the results and print out each field

Similar Posts