MYSQL Help
#1

Well, I'm getting this error. I wanted to edit account's properties like level, money etc. but I can't due to this error. Can you fix it?
Code:
Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.
and this is MYSQL's code.
Code:
  CREATE TABLE IF NOT EXISTS vehicles(id INT(128), model INT(128), X VARCHAR(128), Y VARCHAR(128), Z VARCHAR(128)
, A VARCHAR(128), col1 INT(128), col2 INT(128), owned INT(10), owner VARCHAR(128), mod1 INT(128) NOT NULL DEFAULT '-1', mod2 INT(128) NOT NULL DEFAULT '-1', mod3 INT(128) NOT NULL DEFAULT '-1', mod4 INT(128) NOT NULL DEFAULT '-1', mod5 INT(128) NOT NULL DEFAULT '-1', mod6 INT(128) NOT NULL DEFAULT '-1', mod7 INT(128) NOT NULL DEFAULT '-1', mod8 INT(128) NOT NULL DEFAULT '-1', mod9 INT(128) NOT NULL DEFAULT '-1', mod10 INT(128) NOT NULL DEFAULT '-1', mod11 INT(128) NOT NULL DEFAULT '-1'
, mod12 INT(128) NOT NULL DEFAULT '-1', mod13 INT(128) NOT NULL DEFAULT '-1' , mod14 INT(128) NOT NULL DEFAULT '-1', mod15 INT(128) NOT NULL DEFAULT '-1'
, mod16 INT(128) NOT NULL DEFAULT '-1', mod17 INT(128) NOT NULL DEFAULT '-1', paintjob INT(10), slot INT(10) NOT NULL DEFAULT '0', security INT(128), price INT(128), sprice INT(128), buyable INT(10), vName VARCHAR(128)
, Engine INT(10) NOT NULL DEFAULT '1', Engines INT(10) NOT NULL DEFAULT '0') ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT = 1;
Code:
  CREATE TABLE IF NOT EXISTS houses(ID INT(128), HX VARCHAR(128), HY VARCHAR(128), HZ VARCHAR(128), IX VARCHAR(128) NOT NULL DEFAULT '0', IY VARCHAR(128) NOT NULL DEFAULT '0', IZ VARCHAR(128) NOT NULL DEFAULT '0', Price INT(128), SPrice INT(128), Interior INT(10), World INT(128), Locked INT(10), Owned INT(128), Owner VARCHAR(128), Make INT(10) ) ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT = 1;
Reply
#2

Those tables need primary keys, or else the editor (looks like you're using PHPMyAdmin) will not be able to know what row to update.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=659322
https://sampforum.blast.hk/showthread.php?tid=659536

You have been told several times that you need to set a primary key for the tables and how to do it. If you cannot understand how to do this very easy task, you should consider using y_ini instead. Your database is poorly designed to begin with and you showed no interest on trying to learn SQL. When I asked you if you tried any of the way I explicitly told you, you did not respond but you chose to create yet another thread (4th to be exact as you removed the other one) hoping someone else will fix it for you.
Reply
#4

Quote:
Originally Posted by Calisthenics
View Post
https://sampforum.blast.hk/showthread.php?tid=659322
https://sampforum.blast.hk/showthread.php?tid=659536

You have been told several times that you need to set a primary key for the tables and how to do it. If you cannot understand how to do this very easy task, you should consider using y_ini instead. Your database is poorly designed to begin with and you showed no interest on trying to learn SQL. When I asked you if you tried any of the way I explicitly told you, you did not respond but you chose to create yet another thread (4th to be exact as you removed the other one) hoping someone else will fix it for you.
yes.
Reply
#5

wp poczta
Reply
#6

Quote:
Originally Posted by ropapefeti
View Post
This is English forum. What ever you shared doesnt look like related to OP.
Reply
#7

Here's your vehicles table.
Looks like you were missing a primary key towards `id`.

Code:
CREATE TABLE `vehicles` (
  `id` int(128) NOT NULL,
  `model` int(128) DEFAULT NULL,
  `X` varchar(128) DEFAULT NULL,
  `Y` varchar(128) DEFAULT NULL,
  `Z` varchar(128) DEFAULT NULL,
  `A` varchar(128) DEFAULT NULL,
  `col1` int(128) DEFAULT NULL,
  `col2` int(128) DEFAULT NULL,
  `owned` int(10) DEFAULT NULL,
  `owner` varchar(128) DEFAULT NULL,
  `mod1` int(128) NOT NULL DEFAULT '-1',
  `mod2` int(128) NOT NULL DEFAULT '-1',
  `mod3` int(128) NOT NULL DEFAULT '-1',
  `mod4` int(128) NOT NULL DEFAULT '-1',
  `mod5` int(128) NOT NULL DEFAULT '-1',
  `mod6` int(128) NOT NULL DEFAULT '-1',
  `mod7` int(128) NOT NULL DEFAULT '-1',
  `mod8` int(128) NOT NULL DEFAULT '-1',
  `mod9` int(128) NOT NULL DEFAULT '-1',
  `mod10` int(128) NOT NULL DEFAULT '-1',
  `mod11` int(128) NOT NULL DEFAULT '-1',
  `mod12` int(128) NOT NULL DEFAULT '-1',
  `mod13` int(128) NOT NULL DEFAULT '-1',
  `mod14` int(128) NOT NULL DEFAULT '-1',
  `mod15` int(128) NOT NULL DEFAULT '-1',
  `mod16` int(128) NOT NULL DEFAULT '-1',
  `mod17` int(128) NOT NULL DEFAULT '-1',
  `paintjob` int(10) DEFAULT NULL,
  `slot` int(10) NOT NULL DEFAULT '0',
  `security` int(128) DEFAULT NULL,
  `price` int(128) DEFAULT NULL,
  `sprice` int(128) DEFAULT NULL,
  `buyable` int(10) DEFAULT NULL,
  `vName` varchar(128) DEFAULT NULL,
  `Engine` int(10) NOT NULL DEFAULT '1',
  `Engines` int(10) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `vehicles`
  ADD PRIMARY KEY (`id`);
Here's your houses table, same as vehicles table. You were missing Primary Key on `ID`.

Code:
CREATE TABLE `houses` (
  `ID` int(128) NOT NULL,
  `HX` varchar(128) DEFAULT NULL,
  `HY` varchar(128) DEFAULT NULL,
  `HZ` varchar(128) DEFAULT NULL,
  `IX` varchar(128) NOT NULL DEFAULT '0',
  `IY` varchar(128) NOT NULL DEFAULT '0',
  `IZ` varchar(128) NOT NULL DEFAULT '0',
  `Price` int(128) DEFAULT NULL,
  `SPrice` int(128) DEFAULT NULL,
  `Interior` int(10) DEFAULT NULL,
  `World` int(128) DEFAULT NULL,
  `Locked` int(10) DEFAULT NULL,
  `Owned` int(128) DEFAULT NULL,
  `Owner` varchar(128) DEFAULT NULL,
  `Make` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `houses`
  ADD PRIMARY KEY (`ID`);
Best of luck, if you want to learn how to use MySQL go here: https://www.w3schools.com/sql/default.asp
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)