Eggzorcist Posted May 20, 2011 Share Posted May 20, 2011 I have a question concerning outputting information taken out of the database. Query is as follows: $query = "SELECT * FROM users"; $results = $this->db->query($query); $result = $results->fetch_assoc(); return $result['username']; The value that returns is the first username in the database. But here I am selecting all the usernames, can I select others ones with the fetch_assoc? Link to comment https://forums.phpfreaks.com/topic/237007-select-users-question/ Share on other sites More sharing options...
Maq Posted May 20, 2011 Share Posted May 20, 2011 Look at Example #2: http://us3.php.net/mysql_query You need to loop through the result set, usually using a while loop. Link to comment https://forums.phpfreaks.com/topic/237007-select-users-question/#findComment-1218235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.