MySQL.
#2

I don't think that would work =/.

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 (       );
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.
Reply


Messages In This Thread
MySQL. - by BaubaS - 26.06.2011, 19:04
Re: MySQL. - by [HiC]TheKiller - 26.06.2011, 20:05
Re: MySQL. - by Donya - 26.06.2011, 21:14
Re: MySQL. - by [HiC]TheKiller - 27.06.2011, 05:42
Re: MySQL. - by BaubaS - 27.06.2011, 10:55
Re: MySQL. - by Raimis_R - 27.06.2011, 11:00
Re: MySQL. - by BaubaS - 27.06.2011, 11:01
Re: MySQL. - by Raimis_R - 27.06.2011, 11:02
Re: MySQL. - by WooTFTW - 27.06.2011, 12:02
Re: MySQL. - by BaubaS - 27.06.2011, 13:25

Forum Jump:


Users browsing this thread: 1 Guest(s)