SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/08/2019, 08:55 PM   #1
Dokins
Banned
 
Join Date: Jun 2010
Posts: 1,651
Reputation: 53
Default MySQL Error 1364 - Is there a way to set the default value of all variables in a table?

Title says all! I recently moved host from my PC where it was working without issue to a new host that brings this error every single time someone tries to create an account.

Code:
----- MySQL ERROR -----

   Error ID: 1364
   Error: Field 'CSlot2' doesn't have a default value
   Callback: RegisterPlayer
   Query: INSERT INTO `accounts` (PlayerName, Password, PlayerIP, Level, AdminLevel, Money, Armour, Kills, Deaths, Banned, SkinSlot, Faction, FRank, AdminJail, BanTime, Number, Jail, BankMoney, Weed, Cocaine, ThiefLevel, BirthDate, Gender, CSlot1) VALUES ('Andrew_Norwood', 'C2CB52714AF3A98E6D9067A5E80C7127D6ACA82BB20D56D4CA804A3378230CAE8E26E3422C341BFC22B61EB77874FB6ABED4564A1AC9869FC2E74997D8AB1EE9', '81.207.164.117', 1, 0, 1000 ,0, 0, 0, 0, 1, 0, 0, -1, 0, 0, -1,2500, 0, 0, 1, 19900210, 1, 5)

-----------------------
Dokins is offline   Reply With Quote
Old 25/08/2019, 09:50 PM   #2
Mobtiesgangsa
Big Clucker
 
Join Date: Oct 2016
Posts: 129
Reputation: 16
Default Re: MySQL Error 1364 - Is there a way to set the default value of all variables in a table?

The perfect solution is:

Data are inserted into your MySQL database if you have 24 columns there should be 24 values.

Quote:
PlayerName - Andrew_Norwood
Password - C2CB52714AF3A98E6D9067A5E80C7127D6ACA82BB20D56D4CA 804A3378230CAE8E26E3422C341BFC22B61EB77874FB6ABED4 564A1AC9869FC2E74997D8AB1EE9
PlayerIP - 127.0.0.1
Level - 1
AdminLevel - 0
Money - 0
Armour - 0
Kills - 0
Deaths - 0
Banned - 0
SkinSlot - 0
Faction - 3
FRank - 5
AdminJail - 0
BanTime - 4585476
Number - 32
Jail - 0
BankMoney - 10000
Weed - 1000
Cocaine - 1000
ThiefLevel - 4
Birthdate - 17.18.77
Gender - 1
CSlot1 - "this one is not assinged"
this is example what you are missing that is cossing your error
Mobtiesgangsa is offline   Reply With Quote
Old 26/08/2019, 06:02 AM   #3
SiaReyes
Huge Clucker
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 328
Reputation: 22
Default Re: MySQL Error 1364 - Is there a way to set the default value of all variables in a table?

Code:
`CSlot2` int(11) UNSIGNED NOT NULL DEFAULT '0'
You didn't provide the default value for the coulmn
__________________
Offshowtime Fuck It!

Quote:
Originally Posted by Toroi View Post
blackmail people that join your server using their ip address as hostage

or get a job and play sa-mp for fun
SiaReyes 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
Error on MYSQL table Blackaslan Server Support 5 25/10/2018 10:18 PM
MySQL how get all variables from table at once bigboy81 Scripting Help 6 12/06/2017 08:03 PM
(error #1364) Field 'PlayerID' doesn't have a default value Metharon Scripting Help 2 28/01/2017 09:38 PM
[HELP] Mysql Table Error. KONTROWKEN Scripting Help 4 24/11/2016 08:10 PM
SQLite - Default Values When Initially Creating A Table? DrakeX Scripting Help 2 26/05/2014 02:07 AM


All times are GMT. The time now is 10:37 AM.


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