Jump to content


Mysql Help


7 replies to this topic

#1 MF1

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 22 May 2006 - 02:51 AM

Yeah someone set me up something on mysql and it was working fine when i was created users for some pics but now all im getting is this error that keeps saying this


Error
SQL query:

INSERT INTO `gallery` ( `id` , `owner` , `comment` , `link` )
VALUES (

NULL , 'Cab', 'ol', '/gallerypix/cab44.JPG'
), (
NULL , '', '', ''
)

MySQL said:

#1062 - Duplicate entry '127' for key 1


does anyone one know what this means or can help me? pm me or reply




------mf1

#2 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 22 May 2006 - 09:32 AM

umm give this a go:

INSERT INTO `gallery` (`owner`, `comment`, `link`) VALUES ('Cab', 'ol', '/gallerypix/cab44.JPG')

edit:

oh and make sure that the image you are inserting isnt already inserted as if the column is set to unique and there is already tht img in there then that is the problem

Edited by deadly, 22 May 2006 - 09:33 AM.


#3 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 22 May 2006 - 11:42 AM

I have had this problem a while back (when i was innocent xD)

The problem is not with any query, the person who set up your table did it wrong ;)

To fix it you must simply change the datatype for the ID field or whichevery you are using as a key to "INT".

i reckon it is currently set as tinyint? tinyint has a 127 entry limit :P
So change the key to INT.

Oh and deadly, its an auto increment field so there wouldnt be a duplicate :P

Edited by .Matt, 22 May 2006 - 11:42 AM.


#4 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 22 May 2006 - 12:04 PM

yea its one of those things u cant judge til u have seen the structure of the table / database

edit

i've taken a look at it and yea you were right .Matt it was set as tinyint. Good call, i fixed it up for him.

Edited by deadly, 25 May 2006 - 02:43 AM.


#5 joe

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Location:stuck in the middle of cyber space

Posted 25 May 2006 - 10:03 PM

i've got something like that in a few days ago... :huh:
it because, your data have come in into ur database. Try to come in to your mysql command line and make query :
"select * from gallery";
or, if it's doesn't dissapear, try to delete data from ur table : "delete from gallery";.
My suggest is, try to check ur souce code, because the error came from wrong source code. :D :D

I hope it can help u.... :D :D

#6 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 26 May 2006 - 12:26 AM

i dont have a clue what your on about and it is all fixed.....

#7 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 26 May 2006 - 03:27 AM

View Postjoe, on May 26 2006, 04:03 AM, said:

i've got something like that in a few days ago... :)
it because, your data have come in into ur database. Try to come in to your mysql command line and make query :
"select * from gallery";
or, if it's doesn't dissapear, try to delete data from ur table : "delete from gallery";.
My suggest is, try to check ur souce code, because the error came from wrong source code. :D :D

I hope it can help u.... :) :)

Dont cha just love the way people ignore me? ha :D

Thats a load of rubbbish ;)
But no matter, Glad its fixed Deadly.

#8 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 26 May 2006 - 03:30 AM

yep all down to you thou





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users