473,516 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql create table error

wadro21
12 New Member
can someone tell me what is wrong with this?

Error
SQL query:
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE uploads(
  2.  
  3. upload_id int( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  4. file_name VARCHAR( 30 ) NOT NULL ,
  5. file_size INT( 6 ) UNSIGNED NOT NULL ,
  6. file_type VARCHAR( 30 ) NOT NULL ,
  7. description VARCHAR( 100 ) DEFAULT NULL ,
  8. date_entered TIMESTAMP,
  9. PRIMARY KEY ( upload_id ) ,
  10. KEY ( file_name ) ,
  11. KEY ( date_entered ) 
  12. ) CREATE TABLE urls(
  13. url_id SMALLINT( 4 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  14. url VARCHAR( 60 ) NOT NULL ,
  15. title VARCHAR( 60 ) NOT NULL ,
  16. description SMALLTEXT NOT NULL ,
  17. PRIMARY KEY ( url_id ) 
  18. ) CREATE TABLE url_categories(
  19. url_category_id SMALLINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  20. category VARCHAR( 20 ) NOT NULL ,
  21. PRIMARY KEY ( url_category_id ) 
  22. ) CREATE TABLE url_associations(
  23. ua_id SMALLINT( 4 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  24. url_id SMALLINT( 4 ) UNSIGNED NOT NULL ,
  25. url_category_id TINYINT( 3 ) UNSIGNED NOT NULL ,
  26. date_submitted TIMESTAMP,
  27. approvedCHAR( 1 ) DEFAULT 'N' NOT NULL ,
  28. PRIMARY KEY ( ua_id ) 
  29.  
MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE urls (
url_id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, url VA' at line 7
Sep 4 '07 #1
2 1739
pbmods
5,821 Recognized Expert Expert
Heya, Wadro.

There are two things wrong with the code you posted:
  • You didn't use CODE tags. Bad!
  • You're missing a semicolon after each table declaration.
Sep 4 '07 #2
wadro21
12 New Member
Thanks again!

i will try to remember to put my code in tages next time.
Sep 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
11739
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem...
0
3511
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary form for a number of platforms from our download pages at http://www.mysql.com/downloads/ and mirror sites.
0
1475
by: Ed Smith | last post by:
I have two questions about REFERENCES: 1. It appears that mySQL treats REFERENCES associated with an attribute differently than FOREIGN KEY (<blah>) REFERENCES... Specifically, the first form does not appear to work, while the later does. Here's a simple example (slightly edited): mysql> CREATE TABLE person (id char(5) primary key);...
0
3925
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
4
3258
by: James E Koehler | last post by:
I can't get the WHILE statement to work in MySQL. The version of MySQL that I am using is: Ver 12.16 Distrib 4.0.6-gamma, for Win95/Win98 (i32) running on Windows MX. Here is the relevant section from the manual: 20.1.9.7 WHILE Statement
1
4834
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was wondering if anybody has experienced the same issues
14
6070
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate places in that hosting.
221
366988
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in...
1
9550
ssnaik84
by: ssnaik84 | last post by:
Hi Guys, Last year I got a chance to work with R&D team, which was working on DB scripts conversion.. Though there is migration tool available, it converts only tables and constraints.. Rest of things (stored procedures, functions).. we have to manually edit. That time, we face some interesting challenges.. I failed to document all of them,...
0
7276
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.