GetSQLColumnData Doesn't exists?

Started by Xmair, Aug 29, 2015, 04:21 AM

Previous topic - Next topic

Xmair

else if ( cmd == "readl" )
{
if(GetLetter( player )==0) ClientMessage("No letters received found.",player,255,255,0)
else if (!player.IsSpawned) ClientMessage("You're not spawned.",player,255,255,0)
else
{
local q = QuerySQL( db, "SELECT * FROM letters WHERE SentTo='"+player.Name+"'");
if ( GetSQLColummnData(q,1) )
{
local cashl = GetSQLColumnData( q, 2 );
ClientMessage("Letter from :- " + GetSQLColumnData( q, 3 ) + ".")
ClientMessage("Letter :- " + GetSQLColumnData( q, 1 ) + ".")
ClientMessage("Money sent :- " + GetSQLColumnData( q, 2 ) + ".")
IncCash( player, cashl )
        QuerySQL( db, "DELETE FROM letters WHERE Message='" + msg + "'" );
    FreeSQLQuery( q );
}
}
}
Things I have in this function :-
    function GetLetter.
    function IncCash.
    Table is created.
QuerySQL( db, "CREATE TABLE IF NOT EXISTS letters ( SentTo VARCHAR(32), Message TEXT, Cash NUMERIC, Sentfrom VARCHAR(32) )");Required and up to date everything like plugins and server.exe.
Error :-
onPlayerCommand Error :- The index "GetSQLColumnData" doesn't exists.
Yes, There is data inserted into that table, I've received a letter there.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Mashreq

You have forgot to include player and r, g, b color codes in your ClientMessage as well as you have not defined what is msg while deleting something in database.

Xmair

Thanks Mashreq, I'll test it when I'm on my PC.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Thijn

You have GetSQLColummnData()
Remove that extra m.

Xmair


Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD