SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/01/2020, 09:20 PM   #11
TheLeech
Big Clucker
 
Join Date: Aug 2015
Location: Under your bed
Posts: 173
Reputation: 6
Default Re: MySQL not saving Price, Type, Locked Balance ETC

Quote:
Originally Posted by SiaReyes View Post
check out Mysql_log!
Doesn't say anything in the MySQL Log but in server console says

[21:17:53] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[21:17:53] [debug] Stack pointer (STK) is 0x52CBFF0, heap pointer (HEA) is 0x52DAAB8
[21:17:53] [debug] AMX backtrace:
[21:17:53] [debug] #0 ?? in public dialog_CreateBusiness () from Compile.amx
[21:17:53] [debug] #1 native CallLocalFunction () [004747d0] from samp-server.exe
[21:17:53] [debug] #2 ?? in public OnDialogResponse () from Compile.amx

tried making query size bigger same thing.
__________________
R.i.p Sa-mp.

#Save DL

2Real Roleplay is getting re-made slowly, Discord: https://discord.gg/veaG9bT
2Real Roleplay forums: 2r-rp.com
TheLeech is offline   Reply With Quote
Old 17/01/2020, 07:23 AM   #12
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 958
Reputation: 167
Default Re: MySQL not saving Price, Type, Locked Balance ETC

Quote:
Originally Posted by TheLeech View Post
doesn't insert anything into businesses now.

Code:
mysql_format(g_iHandle, querylist, sizeof(querylist), "INSERT INTO `businesses` (`ID`, `Name`, `EnterX`, `EnterY`, `EnterZ`, `ExitX`, `ExitY`, `ExitZ`, `Interior`, `VirtualWorld`, `Price`, `Type`, `Owned`, `Locked`, `Balance`)\
			VALUES ('%d', '%e', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", id, PCreateName[playerid], BusinessInfo[id][EnterX], BusinessInfo[id][EnterY], BusinessInfo[id][EnterZ], BusinessInfo[id][ExitX], BusinessInfo[id][ExitY], BusinessInfo[id][ExitZ], BusinessInfo[id][Int], id, BusinessInfo[id][Price], BusinessInfo[id][Type], BusinessInfo[id][Owned], BusinessInfo[id][Locked], BusinessInfo[id][Balance]);
			mysql_query(g_iHandle, querylist);
There is a limit for local strings/arrays until run time 3 is given. Declaring `querylist` as static local is one solution but you should really remove unnecessary characters. You only need ` ` for reserved keywords, you only need ' ' for strings. Forcing an integer or float as a string '%d' '%f' you force mysql to convert them internally. By setting default values to these three columns and their values reduces more characters.
__________________
Calisthenics is offline   Reply With Quote
Old 17/01/2020, 08:37 AM   #13
SiaReyes
Huge Clucker
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 433
Reputation: 32
Default Re: MySQL not saving Price, Type, Locked Balance ETC

https://www.w3schools.com/sql/sql_default.asp

Go on with Default values. When you insert a data into a table, it will automatically set default value to unspecified columns.

Example:
Code:
`Price` mediumint(10) unsigned DEFAULT '0',
`Owner` mediumint(10) unsigned DEFAULT '-1',
So, you don't need to provide value for "Price" and "Owner" coulmns in insert query, since when you insert data, the unspecified coulmns in insert query will automatically update it's specified default value.
SiaReyes is online now   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
Business not saving price or type of creation. TheLeech Scripting Help 0 01/02/2019 09:22 PM
Team Balance and Auto Team Balance NeXoR Scripting Help 11 11/10/2016 05:31 PM
[HELP] date mysql saving format type Luca12 Scripting Help 11 09/08/2014 05:40 PM
MySQL R5 changing price, interior issue Type-R Scripting Help 12 09/06/2014 09:04 PM
mysql plugin thread locked, no downloads zgintasz Everything and Nothing 7 27/01/2013 11:17 AM


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


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