Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Creating an Option Drop-Down list
Old 06-01-2005, 09:20 PM Creating an Option Drop-Down list
Novice Talker

Posts: 9
Trades: 0
I'm developing an e-Commerce site and have got this for my database:

CREATE TABLE `products` (
`prodnum` varchar(10) NOT NULL default '',
`name` varchar(50) NOT NULL default '',
`category` text NOT NULL,
`image` varchar(255) NOT NULL default '',
`description` text NOT NULL,
`price` text NOT NULL,
`dateadded` timestamp(14) NOT NULL
) TYPE=MyISAM;

What I want is to create an admin section where I can add a new Product using a PHP page with a form - add product number, name, description, product image, price and date added. Then I want to be able to specify which Product Category the product is added to using a Drop Down box in the form. Is my SQL correct to do this, or should Product Category be a separate table? How do I get the form to post the data into the correct category?

It works OK as above except for displaying the product in the correct category. Also, the date does not display on the page correctly. It comes out on the page as 20050602014511.

Thanks for your help.

Last edited by Funky Monk; 06-02-2005 at 10:52 AM.. Reason: Spelling correction
Funky Monk is offline
Reply With Quote
View Public Profile Visit Funky Monk's homepage!
 
 
Register now for full access!
Old 06-02-2005, 03:19 AM
Marvin Le Rouge's Avatar
Skilled Talker

Posts: 52
Trades: 0
You should have category in a separate table, list categories in a drop-down box with id as the value, so you can directly add a line to the products table when you get all the info (including category id) when form is submitted.
Date displays correctly, as it is a timestamp : you should parse it if you want a more accurate display.
Marvin Le Rouge is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Creating an Option Drop-Down list
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10094 seconds with 12 queries