Fetching data from the result set object and converting the array
$row = MYSQLI_FETCH_ASSOC (Result set object);
To fetch a row of records from a result set object, convert an associative array
$row = Mysqli_fetch_row (Result set object);
To fetch a row of records from the result set object, and convert an indexed array
Example:
<?PHP//1: Create connection$conn=Mysqli_connect("127.0.0.1", "Root", "" "," Dangdang ");//2: Set the encodingMysqli_query($conn, "SET NAMES UTF8");//3: Create SQL, send SQL$sql= "SELECT * FROM Dd_book";$result=Mysqli_query($conn,$sql);//4: Get return result//5: Fetch a row record associative array while($row=Mysqli_fetch_assoc($result)){ Echo $row[' ID '].$row[' title ']. ' <br/> ';}//6: Fetch a row of records, indexed array//while ($row = Mysqli_fetch_row ($result)) {//Echo $row [0]. $row [1]. ' <br/> ';/}?>
PHP MySQL Query