Demonic Posted August 17, 2008 Share Posted August 17, 2008 Alright I have a table called "general" There aren't any unique id's, is there a faster way of getting all the options and values from the generals table without having to define the name and using a foreach e.g..: pseudo $array = array(); $fields = array('domain','download_index',..etc.); foreach($fields as $field) { select blah from blah and append to the $array[$field] = $value } Is there a faster way of doing this? Link to comment https://forums.phpfreaks.com/topic/120103-solved-selecting-values-from-a-mysql-table/ Share on other sites More sharing options...
pocobueno1388 Posted August 17, 2008 Share Posted August 17, 2008 You just want to display everything from the "option" field? It's as simple as this: <?php $query = mysql_query("SELECT option FROM table")or die(mysql_error()); while ($row = mysql_fetch_assoc($query)){ echo $row['option'] .'<br />'; } ?> Link to comment https://forums.phpfreaks.com/topic/120103-solved-selecting-values-from-a-mysql-table/#findComment-618715 Share on other sites More sharing options...
Demonic Posted August 17, 2008 Author Share Posted August 17, 2008 thanks much, will give this a try and thats basically all I want to do. Link to comment https://forums.phpfreaks.com/topic/120103-solved-selecting-values-from-a-mysql-table/#findComment-618723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.