zackcez Posted July 29, 2008 Share Posted July 29, 2008 Well here's my current code: $getFeatures = $db->query("SELECT * FROM features WHERE product='1'"); $feature = mysql_fetch_array($getFeatures); $features = array($feature['text']); foreach ($features as $featuree) { echo"<li>$featuree</li>"; } Any one have any suggestions :s? Link to comment https://forums.phpfreaks.com/topic/117238-solved-foreach-and-mysql/ Share on other sites More sharing options...
ignace Posted July 29, 2008 Share Posted July 29, 2008 $features = mysql_fetch_assoc($result); should give you someting like: array( 0 => array( 'rowfield' => 'rowvalue' ) ); another option is the Iterator class as found in the PHP Standard PHP Library (SPL): http://www.php.net/~helly/php/ext/spl/ or: http://be.php.net/spl Link to comment https://forums.phpfreaks.com/topic/117238-solved-foreach-and-mysql/#findComment-603069 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.