NoMansLand Posted February 20, 2009 Share Posted February 20, 2009 How would i go about a PHP loop to show a certain criteria e.g: database > flower flower | smell | colour Rose Nice Red Tulip Bad Yellow < Sunflower Meh Yellow < say i want to select them and show them but it has more Yellow in the colour, and show them only, how would i go about that? mysql_array or a while loop Kris Link to comment https://forums.phpfreaks.com/topic/146067-php-mysql-loop/ Share on other sites More sharing options...
genericnumber1 Posted February 20, 2009 Share Posted February 20, 2009 See these threads for the PHP: http://www.phpfreaks.com/forums/index.php/topic,95441.0.html http://www.phpfreaks.com/forums/index.php/topic,95443.0.html And a bit of googling can pick up more SQL knowledge than any one person can learn in a day. Link to comment https://forums.phpfreaks.com/topic/146067-php-mysql-loop/#findComment-766801 Share on other sites More sharing options...
Q695 Posted February 20, 2009 Share Posted February 20, 2009 While ($row=...){ ... } Link to comment https://forums.phpfreaks.com/topic/146067-php-mysql-loop/#findComment-766802 Share on other sites More sharing options...
NoMansLand Posted February 20, 2009 Author Share Posted February 20, 2009 [Fri Feb 20 02:51:50 2009] [error] PHP Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/skyitorg/public_html/client/admin/view.php on line 146 This is all im getting.. any idea's? the code is here: $sql = mysql_query("SELECT * FROM receipt WHERE docket = '$docket'"); while($row = mysql_fetch_assoc($sql)) { Link to comment https://forums.phpfreaks.com/topic/146067-php-mysql-loop/#findComment-766865 Share on other sites More sharing options...
genericnumber1 Posted February 20, 2009 Share Posted February 20, 2009 http://www.phpfreaks.com/forums/index.php/topic,95376.0.html the FAQs really encompass a lot of Frequently Asked Questions surprisingly enough. Link to comment https://forums.phpfreaks.com/topic/146067-php-mysql-loop/#findComment-766868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.