DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   mysql problem (http://www.daniweb.com/forums/thread117021.html)

cmax Apr 2nd, 2008 10:05 am
mysql problem
 
hello, everybody
i have a problem , i have table , it contoin column ORDER ID, customer ID, amount, DATE.
a problem when i type or create this table, i make a mistake i dont know where is my mistake when i type in mySQL database BY using ( MYSQL console),


thanks

nav33n Apr 2nd, 2008 10:30 am
Re: mysql problem
 
Whats the error ?

trudge Apr 2nd, 2008 4:28 pm
Re: mysql problem
 
What command did you try to execute? Copy and paste exactly what is on your command line, and the resulting screen.

cmax Apr 3rd, 2008 4:08 am
Re: mysql problem
 
my table is called Orders, it have four column , first col is ORDER ID, second col customer ID, third column is AMOUNT n last colum is DATE,
so ma problem i dont know where i make a mistake,
i was typing that
mysq>
create table orders(
order id INT NOT NULL AUTO_INCREMENT,,
customer id INT NOT NULL,
amount DECIMAL(4,2) NOT NULL,
date DATE NOT NULL,
);

can you help where is a my mistake.

THANKS,

cmax Apr 3rd, 2008 4:21 am
mysql
 
table is called Orders, it have four column , first col is ORDER ID, second col customer ID, third column is AMOUNT n last colum is DATE,
so ma problem i dont know where i make a mistake,
i was typing that
mysq>
create table orders(
order id INT NOT NULL AUTO_INCREMENT,,
customer id INT NOT NULL,
amount DECIMAL(4,2) NOT NULL,
date DATE NOT NULL,
);

can you help where is a my mistake.

THANKS,

nav33n Apr 3rd, 2008 4:22 am
Re: mysql problem
 
There are so many errors.
1. order id should be order_id
2. same with customer id.
3. You have 2 , in order id line
Try this.
 CREATE TABLE orders (
order_id INT NOT NULL AUTO_INCREMENT ,
customer_id INT NOT NULL ,
amount DECIMAL( 4, 2 ) NOT NULL ,
date DATE NOT NULL ,
PRIMARY KEY (order_id)
) ENGINE = InnoDB

nav33n Apr 3rd, 2008 4:48 am
Re: mysql
 
Why are you posting the same question so many times ?

peter_budo Apr 3rd, 2008 10:50 am
Re: mysql problem
 
Threads merged
Quote:

Do not flood the forum by posting the same question more than once (ie in multiple forums).

trudge Apr 3rd, 2008 4:36 pm
Re: mysql problem
 
There may be a problem with that field named 'DATE', as that is a reserved word. It will always have to be quoted in every query. Perhaps better to rename it 'OrderDate' or something that makes sense.


All times are GMT -4. The time now is 7:27 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC