Quotish Error

Home Forums Scripts Geekish.me Scripts Quotish Error

This topic contains 8 replies, has 5 voices, and was last updated by  Casey 2 years ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #13868

    Anonymous

    I’ve tried contacting Hannah about this, but she hasn’t replied. :( I’ve been getting this error everytime I try to post a few quote.

    Duplicate entry '127' for key 1

    The quotes are NOT duplicates. I’ve checked. So I don’t understand where this error is coming from. I never got this error before now. The script used to work great.

    #14546

    Casey
    Participant

    It’s because they are [probably] trying to repeat the ID for the quotes in the DB. It’d be helpful if you could show us the DB info on the quote’s table. Try these in order.

    1) Execute this in PhpMyAdmin to reset its auto_increment which is what I think is glitching it.

    ALTER TABLE #QUOTETABLENAME# AUTO_INCREMENT = 128;

    Obviously fix the #quotestablename# :)

    2) Alternatively, also try rebuilding the table’s indexes to hopefully fix it.

    3) If that doesn’t work try looking in the quote’s table for a row with an ID of 127 and delete it and re-add it in the script, then add the ones you need after.

    If none of these work, you could export the tables structure and data, delete it and re-add it.

    #14547

    Amelie
    Keymaster

    It’ll be because the ID field is a tinyint – the maximum number that can be is 127. The column needs to be changed to an int – I’ll post some code later :)

    #14548

    Amelie
    Keymaster

    Go to your Quotish database in phpMyAdmin and then click the SQL tab, then paste this in:

    ALTER TABLE quotish_quotes CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT

    (where quotish_quotes is your table name – if yours is called something different, write that value there instead)

    That will fix the problem. :)

    #14549

    Anonymous

    I’m sorry, but I don’t understand. :( I’m so confused now. I have no idea what to do with this code you all are giving me or where to put it or anything. :(

    #14550

    Vera
    Participant

    1) Go to phpMyAdmin

    2) Click the Quotish database’s name in left column.

    3) After clicking on that, in the right content section, on the top, you will see a list of tabs: Structure, SQL, Search, Query, Export, Import…

    Click on the one that says SQL

    4) In the text area enter the SQL statement that Amelie posted above.

    Make sure that “quotish_quotes” is the correct table name (i.e. check that this name is present in the list on the left). If it is not, find the correct table name and use that.

    5) Click “go”

    That’s it.

    #14551

    Casey
    Participant

    Amelie, can have any integer with 255 characters or less…depending upon what is set obviously as it’s max field length.

    #14552

    Jem
    Keymaster

    Casey, not sure what you’re saying there… but Amelie is right; tinyint data type only supports up to 127 (that is, the number 127, not 127 characters) unless it’s signed (maybe that’s what you’re referring to?)

    #14553

    Casey
    Participant

    Oh; sorry. Oops, I got confused lol.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.