Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #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.


Antony :0)

Reply With Quote
  #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

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;
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.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 08:29 PM.

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