SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/05/2019, 11:38 AM   #1
YouShootIDodge
Big Clucker
 
Join Date: May 2019
Posts: 84
Reputation: 15
Default Unknown column

This is the mysql log (KING is my name in-game)

Code:
[00:38:13] [plugins/mysql] error #1054 while executing query "SELECT * FROM `players` WHERE `NAME` = KING LIMIT 1": Unknown column 'KING' in 'where clause'
This is the query:

Code:
mysql_format (mysql, query, sizeof (query), "SELECT * FROM `players` WHERE `NAME` = %s LIMIT 1", GetName (playerid));
YouShootIDodge is offline   Reply With Quote
Old 07/05/2019, 11:43 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,176
Reputation: 73
Default Re: Unknown column

add '%s' in code after `NAME`, just like this:
mysql_format (mysql, query, sizeof (query), "SELECT * FROM `players` WHERE `NAME` = '%s' LIMIT 1", GetName (playerid));
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 07/05/2019, 11:48 AM   #3
YouShootIDodge
Big Clucker
 
Join Date: May 2019
Posts: 84
Reputation: 15
Default Re: Unknown column

Ok, thanks
YouShootIDodge 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
Unknown column 'ID' in 'field list' Libbyphay Server Support 2 26/11/2017 07:03 PM
Unknown column in field list penaut Scripting Help 0 05/08/2016 08:51 PM
[Ajuda] MySQL - Unknown Column iTzMatheus PortuguÍs/Portuguese 6 11/11/2015 10:21 PM
[Mysql] Unknown column 'ACNR' Admigo Scripting Help 3 09/07/2013 08:17 PM


All times are GMT. The time now is 07:51 AM.


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