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 > Whats wrong with this query?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-04, 13:57
LiveWire LiveWire is offline
Registered User
 
Join Date: Apr 2004
Posts: 5
Whats wrong with this query?

Code:
CREATE TABLE " . TABLE_PREFIX . "customsigpic (
        userid INT UNSIGNED NOT NULL DEFAULT '0',
        profilepicdata MEDIUMTEXT NOT NULL,
        dateline INT UNSIGNED NOT NULL DEFAULT '0',
        filename VARCHAR(100) NOT NULL DEFAULT '',
        visible SMALLINT NOT NULL DEFAULT '1',
        filesize INT UNSIGNED NOT NULL DEFAULT '0',
        PRIMARY KEY (userid)
)
This is what i get when attemping to run the query

Quote:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax near '" . TABLE_PREFIX . "customsigpic (
userid INT UNSIGNED NOT NULL DEFAULT' at line 1
Error 1064 at www.mysql.com says "ER_PARSE_ERROR 1064 42000"

Any ideas?
Reply With Quote
  #2 (permalink)  
Old 04-08-04, 14:19
LiveWire LiveWire is offline
Registered User
 
Join Date: Apr 2004
Posts: 5
nvm i got it.


create table customsigpic
( userid int unsigned not null default 0
, profilepicdata mediumtext not null
, dateline int unsigned not null default 0
, filename varchar(100) not null default ''
, visible smallint not null default 1
, filesize int unsigned not null default 0
, primary key (userid)
)
Reply With Quote
  #3 (permalink)  
Old 04-08-04, 14:41
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
what are you doing about the prefix?

the whole point of that attempted concatenation was to prepend a prefix to the table name

(i say attempted, because obviously, it didn't work, eh)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 04-08-04, 14:43
LiveWire LiveWire is offline
Registered User
 
Join Date: Apr 2004
Posts: 5
Im using the database to store signatures images in. So users may upload a signature, and it will use there userid for the filename.
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