Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    5

    Unanswered: 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

    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?

  2. #2
    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)
    )

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •