$result = "select * from random_table where id = 1"; $rows = []; while($row = mysqli_fetch_array($result)) { $rows[] = $row; }