Jump to content

Recommended Posts

I have this query:

$query=" SELECT DISTINCT `mod_service`. * , `mod_service_categories` . * FROM `mod_service` LEFT JOIN `mod_service_categories` ON ( `mod_service_categories`.`Id` = `mod_service`.`catid` ) ORDER BY `mod_service_categories`.`priority` ASC ";

I would like to use the result of this query to print out somthing like:

 

1. Category 1  (mod_service_category.name)

      a) subcategory 1  (mod_service.name plus other fields)

      b) subcategory 2  (mod_service.name plus other fields)

      c) subcategory 3  (mod_service.name plus other fields)

 

2. Category 2 (mod_service_category.name)

      a) subcategory 1  (mod_service.name plus other fields)

      b) subcategory 2  (mod_service.name plus other fields)

and continues:

am using foreach loop and still cant get what i want:

thanks in advance:

   

See the logic in the following post on how to 'remember' and detect when a heading value changes and take appropriate action - http://forums.phpfreaks.com/index.php?topic=328053.msg1544137#msg1544137

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.