MySQLi not returning rows in order

seko6363

New Member
This is probably not a very difficult question to answer. I'm having trouble with this PHP function I wrote... it returns the rows line by line, but it's returning them incremented by 4 each time. So the the 1st row will output, then the 5th, then the 9th... \[code\]function showDatabases() {# $_GET variables from the URL.$database = mysql_real_escape_string($_GET['database']);$table = mysql_real_escape_string($_GET['table']); $mysqli = new mysqli('127.0.0.1', 'root', '', $database);$query_one = $mysqli->query("SELECT * from $table");$num_rows = mysqli_num_rows($query_one);$num_fields = mysqli_num_fields($query_one); for ($x = 0; $x < $num_rows; $x++) { for ($c = 0; $c < $num_fields; $c++) { $row = mysqli_fetch_row($query_one); echo($row[$c]."&nbsp;&nbsp;"); } echo("<br/>"); }}\[/code\]Thanks!
 
Back
Top