close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sort for Dynamic Menu

Thread began 1/15/2010 3:57 pm by jaa397769 | Last modified 1/15/2010 5:00 pm by jaa397769 | 640 views | 2 replies |

jaa397769

Sort for Dynamic Menu

How do I set my database to sort in the order that I want for my dynamic menu. Theres seems to be no logic to the order that its sorting in now. The field ID's are not decsending or Ascending, their actually doing both for example

ID 17 Mens Apparel
ID 16 Womens Apparel
ID 15 Youth Apparel
ID 14 Footwear
ID 18 Hunting Apparel
ID 19 Auto
ID 20 Home
ID 21 Camping
ID 22 Fishing
ID 23 Archery
ID 24 Hunting

How do I get it to sought in this order:
Hunting
Archery
Fishing
Camping
Home
Auto
Hunting Apparel
Mens Apparel
Womens Apparel
Youth Apparel
Footwear

Do I have to go into the php admin of MySQL and change the value for the field ID?
Thank you

Sign in to reply to this post

siteontimeBeta Tester

Hi If you are referring to the menu at the top of the page you will need to change this code in the file CSSMenuWriter/cssmw_home/menu.php

<?php
mysql_select_db($database_localhost, $localhost);
$query_menuwriter_productcategories = "SELECT CategoryName, CategoryID FROM productcategories";
$menuwriter_productcategories = mysql_query($query_menuwriter_productcategories, $localhost) or die(mysql_error());
$row_menuwriter_productcategories = mysql_fetch_assoc($menuwriter_productcategories);
$totalRows_menuwriter_productcategories = mysql_num_rows($menuwriter_productcategories);
?>

after FROM productcategories add :

ORDER BY CategoryID DESC

So the code should now read:

<?php
mysql_select_db($database_localhost, $localhost);
$query_menuwriter_productcategories = "SELECT CategoryName, CategoryID FROM productcategories ORDER BY CategoryID DESC";
$menuwriter_productcategories = mysql_query($query_menuwriter_productcategories, $localhost) or die(mysql_error());
$row_menuwriter_productcategories = mysql_fetch_assoc($menuwriter_productcategories);
$totalRows_menuwriter_productcategories = mysql_num_rows($menuwriter_productcategories);
?>


Hope that helps.

Sign in to reply to this post

jaa397769

Thank you

I know what you gave me will work and thank you for the response, but I was able to achieve the same effect by just sorting the table on my sql server it self. Is it wrong that I achieved it that way?

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...