SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 06/10/2018, 06:53 AM   #1
RayanIbrahim
Little Clucker
 
Join Date: Sep 2016
Posts: 37
Reputation: 0
Default MYSQL Help

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;
RayanIbrahim is offline   Reply With Quote
Old 09/10/2018, 03:58 PM   #2
Sithis
Gangsta
 
Join Date: Mar 2013
Location: the Netherlands
Posts: 924
Reputation: 79
Default Re: MYSQL Help

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.
__________________
Developer and owner of https://trinityrpg.com
Sithis is offline   Reply With Quote
Old 09/10/2018, 04:27 PM   #3
Calisthenics
Huge Clucker
 
Join Date: May 2018
Posts: 404
Reputation: 69
Default Re: MYSQL Help

https://forum.sa-mp.com/showthread.php?t=659322
https://forum.sa-mp.com/showthread.php?t=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.
Calisthenics is offline   Reply With Quote
Old 13/10/2018, 12:15 PM   #4
ovelino
Little Clucker
 
Join Date: Oct 2018
Posts: 1
Reputation: 0
Default Re: MYSQL Help

Quote:
Originally Posted by Calisthenics View Post
https://forum.sa-mp.com/showthread.php?t=659322
https://forum.sa-mp.com/showthread.php?t=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.
ovelino is offline   Reply With Quote
Old 23/10/2018, 09:13 AM   #5
ropapefeti
Little Clucker
 
Join Date: Oct 2018
Posts: 1
Reputation: 0
Default Re: MYSQL Help

wp poczta
ropapefeti is offline   Reply With Quote
Old 23/10/2018, 11:21 AM   #6
GTLS
Gangsta
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 868
Reputation: 92
Default Re: MYSQL Help

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

I don't help for rep. I help cuz I was helped in the past.


Some thing for ya. Click em
Basic House System

Simple Speedo

Retired from SAMP Scene. Might open SAMP Forums once in a while.
GTLS is offline   Reply With Quote
Old 23/10/2018, 02:10 PM   #7
Nito
Little Clucker
 
Nito's Avatar
 
Join Date: Dec 2008
Location: Mars
Posts: 16
Reputation: 0
Default Re: MYSQL Help

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
__________________

Join Venture Roleplay
Join our SA-MP Server: samp.ventureroleplay.com:7777
Join our Discord community: ventureroleplay.com/discord

Nito is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket Emre__ Scripting Help 10 30/07/2014 09:26 AM
[Tutorial] [VIDEO] MySQL ORM r38: How to pair GM with MySQL & creation of registration/connection system cArnasLT Tutorials 3 19/05/2014 03:08 PM
[GameMode] MySQL CLEAN GAMEMODE [Whirlpool, MySQL BlueG R7, Cache, Ready Package (Windows)] GiamPy. Gamemode Scripts 13 13/09/2013 05:31 PM
BlueG MySQL plugin - Failed (plugins/mysql.so: undefined symbol: _Z13stringvprintfPKcPc) linuxthefish Plugin Development 10 13/07/2013 11:56 AM
[Tool/Web/Other] MySQL DB Manager - Easily manage your MySQL databases with this remote application fiki574 Tools and Files 13 22/07/2012 10:41 AM


All times are GMT. The time now is 06:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.