mysqli query results to show all rows
问题 I have the following code: include $_SERVER['DOCUMENT_ROOT'].'/include/conn.php'; $query = "SELECT title FROM news_event"; $result = $mysqli->query($query); $row = $result->fetch_array(MYSQLI_BOTH); $row_cnt = $result->num_rows; $result->free(); $mysqli->close(); This is fine if there is only one result as I can just echo $row['title'] but if there are lots of results, how do I get this to loop through and print every row? I'm sure this is really simple but I'm just not sure what I need to