26.06.2011, 20:05
I don't think that would work =/.
This should though
Order by only orders the columns into a certain value, not selects them. The WHERE statement chooses the rows fitting your query and stores them. The functions mysql_fetch_int fetches the single integer value stored in a string.
This should though
pawn Код:
new
Query[ 56 ]
;
format ( Query, 51, "SELECT * FROM `playersdb` WHERE `Job` = '%d'", pData[ playerid ][ pJob ] );
mysql_query ( Query );
mysql_store_result( );
SendClientMessage ( playerid, -1, mysql_num_rows( ) );
mysql_free_result ( );
format ( Query, 56, "SELECT `Name` FROM `playersdb` WHERE `Job` = '%d'", pData[ playerid ][ pJob ] );
mysql_query ( Query );
mysql_store_result( );
new str[50];
format(str, sizeof(str), "Your job is ID %d", mysql_fetch_int());
SendClientMessage ( playerid, str);
mysql_free_result ( );