MySQL: Fields/Rows are empty
#1

Hi guys,

MySQL doesn't load a gang name. I'm getting empty string(""):
pawn Код:
printf( "Name: %s", GetGangName( 1 ) ); // Result: "Name: "
pawn Код:
stock GetGangName( gaujosID )
{
    new
        gPavadinimas[ 22 ]
    ;
    format( query, sizeof( query ), "SELECT `gPavadinimas` FROM `gaujos` WHERE `gID` = %d", gaujosID );
    mysql_query( query );
    mysql_store_result( );
    mysql_get_field( "gPavadinimas", gPavadinimas );
    mysql_free_result( );
    return gPavadinimas;
}
Here is mysql log:
Код:
8:39:37] CMySQLHandler::Query(SELECT gPavadinimas FROM gaujos WHERE gID = 1) - Successfully executed.
 
[18:39:37] >> mysql_store_result( Connection handle: 1 )
 
[18:39:37] CMySQLHandler::StoreResult() - Result was stored.
 
[18:39:37] >> mysql_fetch_field_row( Connection handle: 1 )
 
[18:39:37] CMySQLHandler::FetchField(gPavadinimas) - You cannot call this function now. (Reason: Fields/Rows are empty.)
 
[18:39:37] >> mysql_free_result( Connection handle: 1 )
 
[18:39:37] CMySQLHandler::FreeResult() - Result was successfully free'd.
It says Fields/Rows are empty, but they aren't empty!

How to fix this?


Sorry for my bad English...
Thanks
Reply


Messages In This Thread
MySQL: Fields/Rows are empty - by zgintasz - 12.05.2012, 11:11
Re: MySQL: Fields/Rows are empty - by zgintasz - 12.05.2012, 12:21
Re: MySQL: Fields/Rows are empty - by Pinguinn - 12.05.2012, 12:36
Re: MySQL: Fields/Rows are empty - by AndreT - 12.05.2012, 12:39
Re: MySQL: Fields/Rows are empty - by zgintasz - 12.05.2012, 12:55
Re: MySQL: Fields/Rows are empty - by Pinguinn - 12.05.2012, 14:15
Re: MySQL: Fields/Rows are empty - by AndreT - 12.05.2012, 15:11
Re: MySQL: Fields/Rows are empty - by Evoturk - 12.05.2012, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)