Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6187407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:03:10+00:00 2026-05-24T02:03:10+00:00

I see from reading other posts on this site, there a similar solutions to

  • 0

I see from reading other posts on this site, there a similar solutions to what I am trying to do, but as I’m building in Dreamweaver, some of the syntax is different and I’m not sure what parts I need.

I think there’s an If {} statment to add, just not sure where…

So I have a page for selecting a from a list of cruise holidays, the user chooses where they would like to go from a drop down menu, that then shows the cruises going to that destination. Easy. Next, they can choose when they would like to travel, narrowing the search result down with a jump menu to a particular month

So my first set of records are all the cruises going to say the Caribbean.

There are four, two in April 2012 and two in May 2012.

So I’ve got all four showing in my list, but now I want the user to pick a month, and by populating the jump menu with the destination-filtered recordset, I get four choices

April 2012
April 2012
May 2012
May 2012

What I actually want is

April 2012
May 2012

If I group the records by month in the MySQL query, I don’t get all four cruises in the destination list, which we want.

Here’s the code for the Month selector menu

<select name="jumpMenu2" id="jumpMenu2" onchange="MM_jumpMenu('parent',this,0)">
        <option value="">Select a date</option>
        <?php do { ?>

<option value="chooseacruise.php?destination=<?php echo    urlencode($row_cruises['destination']);?>&<?php echo $row_cruises['departs']?>"><?php echo  date('F Y', strtotime($row_cruises['departs'])); ?></option>

<?php } while ($row_cruises = mysql_fetch_assoc($cruises));
                $rows = mysql_num_rows($cruises);
                if($rows > 0) {
                mysql_data_seek($cruises, 0);
            $row_cruises = mysql_fetch_assoc($cruises);
              }
            ?>
      </select>

The while loop is Dreamweaver’s standard loop to populate the menu. What I want to is write the month, then at the next row, if the month is the same, ignore it.

Thanks in advance

Rich 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:03:11+00:00Added an answer on May 24, 2026 at 2:03 am

    Firstly, this has nothing to do with Dreamweaver. The syntax is the same. Here is a simple solution for you:

    <select name="jumpMenu2" id="jumpMenu2" onchange="MM_jumpMenu('parent',this,0)">
        <option value="">Select a date</option>
        <?php
            $month = ''; 
            while ($row_cruises = mysql_fetch_assoc($cruises)) { 
                if ($row_cruises['departs'] != $month) {
                    $month = $row_cruises['departs'];
                    ?>
                    <option value="chooseacruise.php?destination=<?php echo    urlencode($row_cruises['destination']);?>&<?php echo $row_cruises['departs']?>"><?php echo  date('F Y', strtotime($row_cruises['departs'])); ?></option>
                <?php } ;
            }
    
            if(mysql_num_rows($cruises) > 0) {
                mysql_data_seek($cruises, 0);
                $row_cruises = mysql_fetch_assoc($cruises);
            }
        ?>
      </select>
    

    Please be aware that you have to order the sql query by departs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading this but I didn't really got from there what request-type the
I've been reading through the other posts on this topic tried what was suggested
I am trying to see from an SQL console what is inside an Oracle
I have some really funky code. As you can see from the code below
see this demo from jquery ui you have to hold down the Ctrl key
I was doing some reading on REST this morning and I came across the
I have been reading through other questions on here and there is something that
This question is a spin-off from this one . Some history: when I first
EDIT: after reading all the input from the other users, i decided, to use
This is the page, its a wordpress powered site: http://bit.ly/9oJXWV You select some value,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.