SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 26/05/2017, 12:07 PM   #1
fatlirmorina
Big Clucker
 
Join Date: Nov 2013
Posts: 70
Reputation: 1
Default MySQL error log

Well so I'm just a rookie at MySQL I basicially know the storing, inserting and selecting things out from MySQL but I have no idea what's wrong with this code lol.

[18:46:45 05/25/17] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('3') (Query: "SELECT * FROM `gpci` WHERE `gpci` = '(CENSORED)'")
[18:46:45 05/25/17] [WARNING] CMySQLHandle:eleteSavedResult - invalid result id ('0')

Script:
Code:
COMMAND:match(playerid, params[])
{
    if(!PlayerInfo[playerid][power]) return SendClientError(playerid, CANT_USE_CMD);
    new emri;
    if(sscanf(params, "u", emri)) return SCP(playerid, "<partofname/playerid>");
	new sql[164], gpcija[64], Cache:result;
	gpci(emri, gpcija, sizeof(gpcija));
	mysql_format(sqldb, sql, sizeof sql, "SELECT * FROM `gpci` WHERE `gpci` = '%s'", gpcija);
	mysql_query(sqldb, sql);
	if(cache_num_rows())
	{
	    new rows = cache_num_rows();
	    for(new i; i<=rows; i++)
	    {
		    new emri1[128];
			cache_get_field_content(i, "name", emri1);
			if(strcmp(emri1, PlayerName(emri)) && strcmp(emri1, "NULL"))
			{
				format(iStr, sizeof(iStr), "{ff0000}[AC]: %s matches with %s", emri1, PlayerName(emri));
				SendClientMessage(playerid, -1, iStr);
			}
		}
	}
	else
	{
	    SendClientMessage(playerid, -1, "{ff0000}Can't find any!");
	}
	cache_delete(result);
	return 1;
}
fatlirmorina is offline   Reply With Quote
Old 26/05/2017, 01:33 PM   #2
fatlirmorina
Big Clucker
 
Join Date: Nov 2013
Posts: 70
Reputation: 1
Default Re: MySQL error log

Hello?
fatlirmorina is offline   Reply With Quote
Old 26/05/2017, 04:26 PM   #3
fatlirmorina
Big Clucker
 
Join Date: Nov 2013
Posts: 70
Reputation: 1
Default Re: MySQL error log

Managed to fix it by this, forgot to add the following Cache to the query string.

result = mysql_query(sqldb, sql);
fatlirmorina 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 01:19 AM.


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