Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 23rd, 2006, 09:10 AM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drop down menu

Hi all.
I'm an absolute newbie to this dynamic web development stuff.

I use dreamweaver to develop sites and i would like to know how to store category id's in a drop down menu so that when i enter a product into my form, i can select a category from the drop down menu which adds the correct 'category id' number to the database.

I have 6 categories in the database numbered in the following order:

cat_id 1 > PA and Sound Reinforcement
cat_id 2 > Microphones
cat_id 3 > Signal Processors
cat_id 4 > Guitars and Basses
cat_id 5 > Guitars and Bass Amplifiers
cat_id 6 > Guitars and Bass Effects

I'm using PHP and a mysql database. I'm no coder though.

Thanks

Antony :0)

  #2 (permalink)  
Old January 27th, 2006, 08:45 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Macromedia Another $$$$ to spend....

I can't see How you are going to store a data non-visible into a drop down menu.

Either your drop down list is really small and you can just run PHP to assign to correct category against the selection made;
<?php
if ( $selection == "Speakers 80 Watts" ) { $cat=1; }
?>

or your selection is hudge and I can't see why you are using only 1 drop down menu ??

Surely in your example a bit of javascript with 2 drop down menu will work best:
Drop_down menu 1: Select the Category (here you go)
Drop_down menu 2: Select your Item

So when you change the Category on drop_down menu 1, it auto changed the selection available in drop down menu 2.
example:
http://www.felgall.com/jstip22.htm


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down menu mizlatic BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 February 11th, 2008 07:02 AM
drop-down menu crmpicco Javascript How-To 1 March 22nd, 2005 01:23 PM
right click menu hidden by drop-drown menu Andraw HTML Code Clinic 0 March 18th, 2005 03:28 PM
drop down menu scrowler Javascript 1 January 27th, 2005 05:44 AM
drop down menu junemo Beginning PHP 2 May 7th, 2004 10:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.