SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 29/04/2020, 10:51 AM   #11
xRadical3
Gangsta
 
Join Date: May 2017
Location: Iran
Posts: 645
Reputation: 47
Default Re: mysql not saving players data

Quote:
Originally Posted by Mike861 View Post
That doesn't fix it, still nothing. But i saw this.

Code:
[04/29/20 11:38:08] [ERROR] error #1064 while executing query "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
Try this syntax.
pawn Code:
mysql_format(mysql_database, query, sizeof(query),"UPDATE `PLAYERS` SET `MONEY` = %d, `HEALTH` = %f, `ARMOR` = %f, `XPOS` = %f, `YPOS` = %f, `ZPOS` = %f, `ANGLE` = %f, `INTERIOR` = %d, `VW` = %d WHERE `ID` = %d", Player[playerid][Money], Player[playerid][Health], Player[playerid][Armor], Player[playerid][Xpos], Player[playerid][Ypos], Player[playerid][Zpos], Player[playerid][Angle], Player[playerid][Interior],Player[playerid][VirtualWorld], Player[playerid][ID]);
xRadical3 is offline   Reply With Quote
Old 29/04/2020, 05:28 PM   #12
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default Re: mysql not saving players data

Quote:
Originally Posted by Vizi10 View Post
Try this syntax.
pawn Code:
mysql_format(mysql_database, query, sizeof(query),"UPDATE `PLAYERS` SET `MONEY` = %d, `HEALTH` = %f, `ARMOR` = %f, `XPOS` = %f, `YPOS` = %f, `ZPOS` = %f, `ANGLE` = %f, `INTERIOR` = %d, `VW` = %d WHERE `ID` = %d", Player[playerid][Money], Player[playerid][Health], Player[playerid][Armor], Player[playerid][Xpos], Player[playerid][Ypos], Player[playerid][Zpos], Player[playerid][Angle], Player[playerid][Interior],Player[playerid][VirtualWorld], Player[playerid][ID]);
That might fix the error, but my issue still remains. I wonder what could it possibly be..
Mike861 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 not saving data Magic_Time Scripting Help 0 10/08/2015 04:00 AM
Saving players health data Arastair Scripting Help 2 07/02/2015 03:22 AM
MySQL saving Data yanir3 Scripting Help 5 24/06/2013 07:27 PM
MYSQL, saving players data. Richie© Scripting Help 4 19/06/2013 07:07 PM
Mysql Saving Data Stefand Scripting Help 7 07/05/2013 10:42 AM


All times are GMT. The time now is 06:26 AM.


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