Solved

Dynamic list menu options only displaying top product

Posted on 2010-11-30
5
328 Views
Last Modified: 2012-05-10
Hi there,
I have created a product page where you click on the category and then only those products show up in the drop down list on the page, HOWEVER only the first product is showing up in the dropdown.  Attached is code.  Any help really appreciated.
MsKazza

 products.php
0
Comment
Question by:Karen Liddy
  • 3
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 34243773
Hi MsKazza,

The code looks correct.  Can I get a URL to test?  If not, can you paste a sample URL so I can check the query string?
0
 

Author Comment

by:Karen Liddy
ID: 34244030
Hi Jason,

thanks for response.  site not live yet so sample url is : http://localhost/agraphics/products.php?recordID=5

Hope this is what you were looking for.
Link on menu.php is : <a href="products.php?recordID=<?php echo $row_sections['sectionID']; ?>"><?php echo $row_sections['sectionName']; ?></a>

Thanks,

MsKazza
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 200 total points
ID: 34244518
products.php?recordID

That's correct, too.  Weird.

Try removing the Dynamic List/Menu behavior and re-applying it.
0
 

Accepted Solution

by:
Karen Liddy earned 0 total points
ID: 34261740
   <option value="<?php echo $row_products['pID']?>"<?php if (!(strcmp($row_products['pID'], "recordID"))) {echo "selected=\"selected\"";} ?>><?php echo $row_products['pName']?></option>
    <?php
} while ($row_products = mysql_fetch_assoc($products));
  $rows = mysql_num_rows($products);
  if($rows > 0) {
      mysql_data_seek($products, 0);
        $row_products = mysql_fetch_assoc($products);
  }


Thanks for the help Jason, this is what finally did it.
:) been driving me nuts for ages, now i finally got it.

MsKazza
0
 

Author Closing Comment

by:Karen Liddy
ID: 34289929
Although Jason spent the time to look over my code, which I really appreciated, it was myself in the end that actually managed to solve the problem.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question