Jump to content

Need some array help BIGTIME!!!


johnvca

Recommended Posts

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!!!

Link to comment
https://forums.phpfreaks.com/topic/224457-need-some-array-help-bigtime/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.