SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 19/01/2019, 05:41 PM   #1
rockys
Little Clucker
 
Join Date: Oct 2018
Location: pawn
Posts: 49
Reputation: 0
Default mysql error

HTML Code:
new query[400];
mysql_format(SQL,query,500,"INSERT INTO `factions_chat` (`text`,`playerid`,`factionid`) VALUES ('%s','%d','%d')",string,PlayerInfo[playerid][pSQLID],PlayerInfo[playerid][pMember]);
mysql_tquery(SQL,query,"","");



error:
(error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ca eu atunci am iesit','1200','8')' at line 1 (Query: "INSERT INTO `factions_chat` (`text`,`playerid`,`factionid`) VALUES ('(Faction Las Venturas Police Department) ()x(): numa' ca eu atunci am iesit','1200','8')")
rockys is offline   Reply With Quote
Old 20/01/2019, 01:24 AM   #2
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 124
Reputation: 0
Default Re: mysql error

Use %e instead of %s. It escapes the ' sign.
StRaphael 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] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to you lulo356 Scripting Help 3 24/07/2015 05:58 AM
(error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for t SandKing94 Scripting Help 3 22/05/2015 08:53 AM
[MYSQL ERROR ] Access denied for user 'your username here'@'localhost' (using password: YES) (error ID: 1045). SpikY_ Scripting Help 3 07/11/2014 04:09 PM
MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket Emre__ Scripting Help 10 30/07/2014 08:26 AM
Mysql queriesYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for th audriuxxx Scripting Help 4 11/04/2014 06:42 PM


All times are GMT. The time now is 05:18 AM.


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