Itutorial
Legendary OT User
- Joined
- Dec 23, 2014
- Messages
- 2,461
- Solutions
- 68
- Reaction score
- 1,123
Should create an array with the array created from the database info then return it.
Right now nothing happens so the $serverarrys isn't being populated clearly. Cant figure out why.
PHP:
$serverArrays = array();
$sql = "SELECT * FROM servers WHERE id >= $startID AND id <= $endID";
if ($conn->query($sql)) {
do {
// Store first result set
if ($result = $conn->store_result()) {
while ($row = $result->fetch_row()) {
$tmpArray = array();
$tmpArray[0] = $row['id'];
$tmpArray[1] = $row['name'];
$tmpArray[2] = $row['ip'];
$tmpArray[3] = $row['protocol'];
$tmpArray[4] = $row['port'];
$tmpArray[5] = $row['players'];
$tmpArray[6] = $row['maxplayers'];
$tmpArray[7] = $row['exprate'];
$tmpArray[8] = $row['website'];
array_push($serverArrays, $tmpArray);
}
$result->free_result();
}
//Prepare next result set
} while ($conn->next_result());
}
Right now nothing happens so the $serverarrys isn't being populated clearly. Cant figure out why.