Please help: SQL query not working

Discussion in 'Programming' started by Drew007, Sep 11, 2006.

  1. #1
    I am attempting to install the free Unobtrusive AJAX Star Rating Bar (http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/) script and I am running this query. For some reason it will not work:

    Any help would be greatly appreciated. Thanks in advance.
     
    Drew007, Sep 11, 2006 IP
  2. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Please post the error also. you tried to install from console or from phpmyadmin.

    Regards

    P.S. Probably you run a different version of mysql ...
     
    sacx13, Sep 12, 2006 IP
  3. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm going to bet it's because of the quotes around the default values for the int columns (the zeros) and the fact that you're using a strict MySQL.

    But sacx13 is right: call mysql_error in your PHP and see what the error is!
     
    TwistMyArm, Sep 12, 2006 IP
  4. Drew007

    Drew007 Peon

    Messages:
    310
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the help so far. The error is listed below. I looked it up but couldn't make any sense of how to fix it.

     
    Drew007, Sep 12, 2006 IP
  5. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Oh OK. You probably need to set a default value for 'id', too (seeing as it can't be NULL).

    Try replacing:
    'id' varchar(11) NOT NULL,

    with:
    'id' varchar(11) NOT NULL default '',

    By the way, that's two single quotes right next to each other... not a double quote.
     
    TwistMyArm, Sep 12, 2006 IP
  6. vdd

    vdd Peon

    Messages:
    34
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Try to use ` instead of '
     
    vdd, Sep 12, 2006 IP
  7. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #7
    There are other people reporting this issue in the comments on the blog.
     
    mad4, Sep 12, 2006 IP
  8. Drew007

    Drew007 Peon

    Messages:
    310
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    @TwistMyArm, @vdd,

    THANKS SO MUCH!! That worked perfectly!
     
    Drew007, Sep 13, 2006 IP