[HELP] SQL #1062 +rep
#1

hello

i have problem , when i Exйcuter sql , is say me this error (

Код:
#1062 - Duplicate entry '1' for key 'PRIMARY'
this :
Код:
--
-- Structura de tabel pentru tabelul `BarziniFamilyCars`
--

CREATE TABLE IF NOT EXISTS `BarziniFamilyCars` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Model` int(3) NOT NULL,
  `PosX` float NOT NULL,
  `PosY` float NOT NULL,
  `PosZ` float NOT NULL,
  `Angle` float NOT NULL,
  `Color1` int(3) NOT NULL,
  `Color2` int(3) NOT NULL,
  `TRespawn` int(11) NOT NULL,
  `Rank` int(1) NOT NULL,
  `Plate` text NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Salvarea datelor din tabel `BarziniFamilyCars`
--

INSERT INTO `BarziniFamilyCars` (`ID`, `Model`, `PosX`, `PosY`, `PosZ`, `Angle`, `Color1`, `Color2`, `TRespawn`, `Rank`, `Plate`) VALUES
(1, 463, 1094.52, -1186.97, 17.8647, 178.745, 245, 245, 4000, 1, 'LS 1 BRZ'),
(2, 521, 1098.14, -1186.86, 17.9114, 185.248, 245, 245, 4000, 1, 'LS 2 BRZ'),
(3, 445, 1109.17, -1193.22, 17.9794, 87.4464, 245, 245, 4000, 1, 'LS 3 BRZ'),
(4, 421, 1087.74, -1192.35, 18.069, 270.91, 245, 245, 4000, 1, 'LS 4 BRZ'),
(5, 567, 1093.85, -1227.3, 15.6866, 180.149, 245, 245, 4000, 1, 'LS 5 BRZ'),
(6, 482, 1098.86, -1227.58, 15.9397, 177.744, 245, 245, 4000, 1, 'LS 6 BRZ'),
(7, 419, 1089.92, -1219.59, 17.739, 269.26, 245, 245, 4000, 1, 'LS 7 BRZ'),
(8, 409, 1102.02, -1219.91, 17.6047, 89.7216, 245, 245, 4000, 1, 'LS 8 BRZ'),
(9, 535, 1105.28, -1227.15, 15.5913, 181.31, 245, 245, 4000, 1, 'LS 9 BRZ'),
(10, 567, 1086.87, -1226.37, 15.6908, 181.161, 245, 245, 4000, 1, 'LS 10 BRZ');
Reply
#2

You probably already have the table `BarziniFamilyCars` and probably you already have at least a row there that has the value of the column `ID` 1. Delete the whole table or edit the `ID` values.

You set the column `ID` as PRIMARY. So each row from the table must have a different value on that column.
Reply
#3

Thanks for answer.

what i edit ?( , see my SQL : http://pastebin.com/6kHecq61
Reply
#4

I don't know what you have in your database so i don't know what you should edit. Just keep in mind that the values of the primary keys can't be the same. You can like delete the rows in your tables that are having the same `ID` values as the ones in you SQL file.

P.S: I see that you are trying to configure the Booter gamemode as many people did in the recent time. Keep in mind that that gm has bugs and that you must have high scripting knowledge in order to fix them or update that GM. So i don't know how you'll manage to do that if you're tangleing from the begging. Anyway, not my bussines.
Reply
#5

i edit , and another error :
Код:
#1136 - Column count doesn't match value count at row 1
________________
OMG how u know it ?

and read your PM.
Reply
#6

If you edited this by yourself, you sure didn't did it right. Check if you didn't skipped value. You can do something like.

pawn Код:
--
-- Structura de tabel pentru tabelul `BarziniFamilyCars`
--

CREATE TABLE IF NOT EXISTS `BarziniFamilyCars` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Model` int(3) NOT NULL,
  `PosX` float NOT NULL,
  `PosY` float NOT NULL,
  `PosZ` float NOT NULL,
  `Angle` float NOT NULL,
  `Color1` int(3) NOT NULL,
  `Color2` int(3) NOT NULL,
  `TRespawn` int(11) NOT NULL,
  `Rank` int(1) NOT NULL,
  `Plate` text NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
//11 columns
--
-- Salvarea datelor din tabel `BarziniFamilyCars`
--

INSERT INTO `BarziniFamilyCars` (`ID`, `Model`, `PosX`, `PosY`, `PosZ`, `Angle`, `Color1`, `Color2`, `TRespawn`, `Rank`, `Plate`) VALUES
(1, 463, 1094.52, -1186.97, 17.8647, 178.745, 245, 245, 4000, 1, 'LS 1 BRZ'), //11 values, 10 commas
(2, 521, 1098.14, -1186.86, 17.9114, 185.248, 245, 245, 4000, 1, 'LS 2 BRZ'), //11 values, 10 commas
(3, 445, 1109.17, -1193.22, 17.9794, 87.4464, 245, 245, 4000, 1, 'LS 3 BRZ'), //11 values, 10 commas
(4, 421, 1087.74, -1192.35, 18.069, 270.91, 245, 245, 4000, 1, 'LS 4 BRZ'), //11 values, 10 commas
(5, 567, 1093.85, -1227.3, 15.6866, 180.149, 245, 245, 4000, 1, 'LS 5 BRZ'), //11 values, 10 commas
(6, 482, 1098.86, -1227.58, 15.9397, 177.744, 245, 245, 4000, 1, 'LS 6 BRZ'), //11 values, 10 commas
(7, 419, 1089.92, -1219.59, 17.739, 269.26, 245, 245, 4000, 1, 'LS 7 BRZ'), //11 values, 10 commas
(8, 409, 1102.02, -1219.91, 17.6047, 89.7216, 245, 245, 4000, 1, 'LS 8 BRZ'), //11 values, 10 commas
(9, 535, 1105.28, -1227.15, 15.5913, 181.31, 245, 245, 4000, 1, 'LS 9 BRZ'), //11 values, 10 commas
(10, 567, 1086.87, -1226.37, 15.6908, 181.161, 245, 245, 4000, 1, 'LS 10 BRZ'); //11 values, 10 commas
Reply
#7

Where i edit this values ? ,read PM
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)