If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MYSQL Create Table Syntax

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-29-09, 10:35
Schweppesale Schweppesale is offline
Registered User
 
Join Date: Jun 2009
Posts: 33
MYSQL Create Table Syntax

Hi, I'm trying to create a table, however it seems the syntax is incorrect. Am I missing something obvious?

Code:
DROP TABLE IF EXISTS `jos_keyword_stats`;

CREATE TABLE `jos_keyword_stats` (
`KeyID` INT NOT NULL ,
`Date` DATE NOT NULL ,
`Time` TIME NOT NULL ,
`Location` MEDIUMTEXT NOT NULL ,
`UserIP` TEXT NOT NULL ,
`UserAgent` TEXT NOT NULL ,
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY
) ENGINE = MYISAM;
Reply With Quote
  #2 (permalink)  
Old 06-29-09, 11:49
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Nothing incorrect with that syntax. I'd say TEXT is overkill for an IP address field, but other than that the table creates just fine.

how are you trying to create this? via mysql client or a front end application?
Reply With Quote
  #3 (permalink)  
Old 06-29-09, 12:00
Schweppesale Schweppesale is offline
Registered User
 
Join Date: Jun 2009
Posts: 33
actually I've just created my first Joomla component. In order to finalize it I need to include a "install.sql" file which create all necessary tables. I continue to receive the following error message though:

Component Install: SQL error or missing or unreadable SQL file. DB function reports no errors
Install Component Error

I was pretty sure that the problem was in the MYSQL statement, however I guess that's not the case.
Reply With Quote
  #4 (permalink)  
Old 06-29-09, 15:41
Schweppesale Schweppesale is offline
Registered User
 
Join Date: Jun 2009
Posts: 33
wish there was a way to mark this as solved. Thanks for your help though.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On