Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.