Author |
Message |
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Thu Apr 04, 2002 7:55 pm (22 years ago) |
|
Hi
I am a complete beginner at databases and I found this tutorial
http://htmlgoodies.com/beyond/database_p1.html
This is the frist SQL statement it gave:
CREATE TABLE contacts (
contact_id INT IDENTITY (1, 1) NOT NULL ,
first_name CHAR (30) NULL ,
last_name CHAR (50) NULL ,
email VARCHAR (75) NULL
);
I wasn't really sure what to do with this and I want to stay away from Access. I went to phpMyAdmin, clicked on the database name, and in the first text box (Run SQL query/queries on database) I copied it in and pressed Go. I then got an error back!
What am I actually meant to do with that code?
Bill |
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Thu Apr 04, 2002 10:28 pm (22 years ago) |
|
Thats what I thought it would but I got an error of:
Quote: | MySQL said:
You have an error in your SQL syntax near 'IDENTITY (1, 1) NOT NULL ,
first_name CHAR (30) NULL ,
last_name CHAR (50) N' at line 2
|
Huh?!
Bill |
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Fri Apr 05, 2002 9:27 am (22 years ago) |
|
Don't worry! It's really annoying me now!!
Bill |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Fri Apr 05, 2002 12:04 pm (22 years ago) |
|
What version of MySQL are you running? If I have interpreted this correctly the IDENTITY function was added in version 4 of MySQL. I tested it on F2S and got the same error as you and they still use version 3.23.24
Quote: | D.1.3 Changes in release 4.0.0
..
..
Added IDENTITY as a synonym for AUTO_INCREMENT (like Sybase). |
Excerpt from: http://www.mysql.com/doc/N/e/News-4.0.0.html
BTW I'm certainly no expert so I could be talking nonsense |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Fri Apr 05, 2002 12:30 pm (22 years ago) |
|
Code: | CREATE TABLE contacts (
contact_id INT(2) NOT NULL,
first_name CHAR(30),
last_name CHAR(50),
email VARCHAR(75),
UNIQUE (contact_id)) |
This is the SQL phpmyadmin use to create a simililar table to the one you were trying to create. |
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Fri Apr 05, 2002 1:08 pm (22 years ago) |
|
F2S behind on the times again! Do you think there is any way I can make them update or is that expensive?! Can't I download a newer version or something?
Thanks for the statement that will work for me!
Bill |
|
|
|
|
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Fri Apr 05, 2002 1:18 pm (22 years ago) |
|
MySQL 4 isn't stable yet...........
Quote: |
www.mysql.com says
Stable
MySQL 3.23.49a
MySQL-Max 3.23.49a
MyODBC 2.50 2.50.39
MySQL++ 1.7.9
MySQLGUI 1.7.5
Development
MySQL 4.0.1
MySQL-Max 4.0.1
MyODBC 3.51 3.51.02
MyCC 0.8.2
|
|
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Fri Apr 05, 2002 1:53 pm (22 years ago) |
|
Oh! That tutorial is pretty useless then!
Bill |
|
|
|
|
|
Page generation time: 0.205566 seconds :: 18 queries executed :: All Times are GMT
Powered by
phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme