Results 1 to 5 of 5

Thread: i seem to be bad at spelling, but...

  1. #1

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609

    i seem to be bad at spelling, but...

    ... can anyone find a problem with this query ?
    PHP Code:
        mysql_query("create table GDB_poll (p_num int(11) not null,
            type set(‘question’,’title’,’no_of_ques’,’option’,’result’) not null,
            value tinyblob not null,
            extra int(11))"
    ) or die ("<br>Error Creating Table 2. Possible reason: table already exists");
        ECHO 
    "$success | GDB_poll table created <br>\n"
    i think it might be the 'set' thing, but i cant seem to get it working

  2. #2
    scoutt
    Guest
    yeah I see a problem.

    mysql_query("create table GDB_poll (p_num int(11) not null,
    type set(‘question’,’title’,’no_of_ques’,’option’,’result’) not null, value tinyblob not null,
    extra int(11))") or die ("<br>Error Creating Table 2. Possible reason: table already exists");
    ECHO "$success | GDB_poll table created <br>\n";


    can't have spaces in the name of the column (I don't think) and you have the name of the column as type set but what is after it? it should be text or varchar(100) or something.

    and I think value is a mysql reserved word.

  3. #3
    scoutt
    Guest
    ahh it is to early in the morning.
    type is reserved for mysql, exchange type for the column name.

    try this

    PHP Code:
    mysql_query("create table GDB_poll (p_num int(11) not null, 
    p_something set('question','title','no_of_ques','option','result') not null, p_value tinyblob not null, 
    extra int(11))"
    ) or die ("<br>Error Creating Table 2. Possible reason: table already exists"); 
    ECHO 
    "$success | GDB_poll table created <br>\n"
    and why are you using ` instead of ' also I don't think this is what you are after but you can try it.

  4. #4

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    thanx scoutt, i'll give that a try the minute i have a chance

  5. #5

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    well, it now works all i did was replace every ` with a ' , dont ask why they were like that in the first place

Posting Permissions

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



Click Here to Expand Forum to Full Width