Problem in MySQL, help
#1

When I try to check if an account already exists in my login system, I come across the following error

** [MySQL]: 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 ''Alfred_Mister'' at line 1

Code responsible for verification:

Код:
function:Player_Init(playerid)
{
	static const empty_player[playerData];
	PlayerData[playerid] = empty_player;

	GetPlayerName(playerid, PlayerData[playerid][pUsername], MAX_PLAYER_NAME);


	new query[103];
	mysql_format(g_iHandle, query, sizeof query, "SELECT * FROM `characters` WHERE `AcountName` = '%s' LIMIT 1", PlayerData[playerid][pUsername]);
	mysql_tquery(g_iHandle, query, "r@Player_Init", "d", playerid);

	return true;
}
Reply
#2

Being honest, the query looks alright to me, it runs fine on my server actually. Give a try without the quotes and escaping the nickname:
PHP код:
SELECT FROM characters WHERE AcountName '%e' LIMIT 1
Which plugin version are you using?
Reply
#3

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Being honest, the query looks alright to me, it runs fine on my server actually. Give a try without the quotes and escaping the nickname:
PHP код:
SELECT FROM characters WHERE AcountName '%e' LIMIT 1
Which plugin version are you using?
R39-6

The error persists
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)