connect_errno > 0) die('Unable to connect to database [' . $db->connect_error . ']'); $query = 'SELECT * FROM queue ORDER BY queue_id ASC'; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); while($line = $result->fetch_array(MYSQLI_ASSOC)) { echo "{$line['queue_command']}\n"; } // Free resultset and close connection mysqli_free_result($result); $db->close(); ?>