Jump to content

[SOLVED] DATE field help!


Cassie_au

Recommended Posts

hey guys!!

 

found this forum while looking for help :s

 

im currently doing an assignment for school with php and mysql.

 

i need to setup some tables for items in a shop, however i need to include foreign keys.

could anybody give me any ideas as to which table fields would link to what? (as an example)

 

thanks in advanced guys! :D

Link to comment
https://forums.phpfreaks.com/topic/105157-solved-date-field-help/
Share on other sites

hey mezise!

 

thanks for the help!  :D that actually answered a lot of my questions!

 

however ive come across another prob:

 

im making a table for members when they sign up. i have a field for Date of Birth, what field type should it be? DATE?

 

thanks again guys! ;D

Hey thanks again mezise! ;D

 

sorry my questions must sound so dumb to yous.

 

i have to make an 'orders' table also.

besides: id, date, customer_id, and amount fields, shouldn't there also be a field for the product(s) theyre ordering? and what if there's more than one product?

 

thanks in advanced!  :D

should product_id be a foreign key with PRODUCTS.id?

Yes, correct, as the name suggests (I thought it was obvious).

 

and what would happen if there is more than one item in the order?

ORDERS_PRODUCTS will be filled with first record with appropriate order_id and product_id and every next record with the same order_id and succeeding product_id.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.