SA-MP Forums Archive
Mysql problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mysql problem (/showthread.php?tid=258843)



Mysql problem - gedux123775 - 01.06.2011

Hey, I have encountered a problem and what is wrong in this script?
pawn Code:
new query[256];
format( query, 256, "SELECT SQLid FROM `transportas` WHERE Model = '%d' AND cOwner = '%s'", CarInfo[playerDB[playerid][tr]][cModel],CarInfo[playerDB[playerid][tr]][cOwner] );
    mysql_query( query );
    mysql_store_result( );
    CarInfo[playerDB[playerid][tr]][vSQLid] = strval( query );
    mysql_free_result( );
Mysql log:
Code:
[21:36:04] CMySQLHandler::Query(SELECT SQLid FROM `transportas` WHERE Model = '468' AND cOwner = 'Carl_Solts') - Successfully executed.

[21:36:04] >> mysql_store_result( Connection handle: 1 )

[21:36:04] CMySQLHandler::StoreResult() - Result was stored.

[21:36:04] >> mysql_free_result( Connection handle: 1 )

[21:36:04] CMySQLHandler::FreeResult() - Result was successfully free'd.
Please help!


Re: Mysql problem - PrawkC - 01.06.2011

Why does

CarInfo[playerDB[playerid][tr]][vSQLid]

Look so messed up?

I assume that is where your problem lies...


Re: Mysql problem - gedux123775 - 01.06.2011

with CarInfo [playerDB [playerid] [tr]] [vSQLid] really okay


Re: Mysql problem - PrawkC - 01.06.2011

Hmm wait, in your db is vsqlid an int? if so then do

CarInfo[playerDB[playerid][tr]][vSQLid] = mysql_fetch_int();

assuming that you're using g stylez plugin, if not find a function similar.


Re: Mysql problem - gedux123775 - 02.06.2011

Don't work. What it is wrong, please help.