4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 phpMyAdmin and Database help!
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Thu Apr 04, 2002 7:55 pm (22 years ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Thu Apr 04, 2002 10:28 pm (22 years ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Fri Apr 05, 2002 9:27 am (22 years ago) Reply with QuoteBack to Top

Don't worry! It's really annoying me now!!

Bill
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Fri Apr 05, 2002 12:04 pm (22 years ago) Reply with QuoteBack to Top

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 Laughing
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Fri Apr 05, 2002 12:30 pm (22 years ago) Reply with QuoteBack to Top

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.
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Fri Apr 05, 2002 1:08 pm (22 years ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Fri Apr 05, 2002 1:18 pm (22 years ago) Reply with QuoteBack to Top

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


OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Fri Apr 05, 2002 1:53 pm (22 years ago) Reply with QuoteBack to Top

Oh! That tutorial is pretty useless then!

Bill
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.116405 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme