Mysql: syntax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • russellg
    Junior Member
    • Mar 2006
    • 28

    Mysql: syntax

    What is the syntax to rectify this error?
    Code:
    user error: Duplicate entry 'modules/playlist/playlist.module' for key 1
    query: INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('playlist', 'Enables the creation of playlists, which contain audio tracks.', 'module', 'modules/playlist/playlist.module', 1, 1, 0) in /home/username/public_html/includes/database.mysql.inc on line 66.
    TIA
  • james
    Senior Member
    • Mar 2004
    • 183

    #2
    By the looks of it, the the filename column has some kind of key on it (maybe a UNIQUE or PRIMARY key).

    In other words, only unique values are allowed in this field.

    try:
    Code:
    SELECT * FROM system WHERE filename='modules/playlist/playlist.module'
    That will tell you what other record also has the same data in the filename field.

    You will either have to delete this row, or change the database schema so that the filename column does not have to be unique.

    Comment

    • cohesive
      Junior Member
      • Jan 2005
      • 5

      #3
      Couldn't the key be on any of the fields, not just filename?

      Comment

      • james
        Senior Member
        • Mar 2004
        • 183

        #4
        Hi Cohesive,

        The error says "Duplicate entry 'modules/playlist/playlist.module' for key 1", which would mean that the field containing that data would be the duplicate.

        Looking at the SQL insert query, this entry is in the fourth field across, which corresponds to the filename column.

        Cheers,

        James

        Comment

        Working...