johnvca Posted January 14, 2011 Share Posted January 14, 2011 OK so I'm having a serious brain fart here... Could someone help me figure something out please? I'm trying to get titles of salon processes to display and have each individual service display underneath. For example, if it's hair color services, I want hair color services in bold with a list of all hair color services underneath. Here's my code: $results = mysql_query( "SELECT * " . "FROM menu " . "INNER JOIN menu_process " . "ON menu_process.id=menu.process_id " . "WHERE menu.category_id=1 " . "ORDER BY menu.process_id" ); while ($data = mysql_fetch_array($results)) { $title = $data["process"]; $service = $data["service"]; printf ("<b>$title</b><br />$service"); }; What this is returning is the title (ie. hair color services) above EVERY hair color service listed below. Now there are about 5 or 6 titles in the database and each has about 10 items to display underneath as services. HELP PLEASE!!! Quote Link to comment https://forums.phpfreaks.com/topic/224457-need-some-array-help-bigtime/ Share on other sites More sharing options...
johnvca Posted January 15, 2011 Author Share Posted January 15, 2011 anyone??? Quote Link to comment https://forums.phpfreaks.com/topic/224457-need-some-array-help-bigtime/#findComment-1159984 Share on other sites More sharing options...
PFMaBiSmAd Posted January 15, 2011 Share Posted January 15, 2011 See the method used in this post - http://www.phpfreaks.com/forums/php-coding-help/retrive-from-mysql-by-date/msg1504124/#msg1504124 Quote Link to comment https://forums.phpfreaks.com/topic/224457-need-some-array-help-bigtime/#findComment-1159988 Share on other sites More sharing options...
johnvca Posted January 18, 2011 Author Share Posted January 18, 2011 Thank you so much, that worked great! These forums are a fantastic resource! Quote Link to comment https://forums.phpfreaks.com/topic/224457-need-some-array-help-bigtime/#findComment-1161378 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.