08.01.2013, 18:55
i'm geting this in log:
the script:
why is i returnging more rows than i soudl?
Quote:
[21:07:04] CMySQLHandler::Query(SELECT `vardas`,`admin`,`online` FROM `minim` WHERE `admin` > '0') - Successfully executed. [21:07:04] >> mysql_store_result( Connection handle: 1 ) [21:07:04] CMySQLHandler::StoreResult() - Result was stored. [21:07:04] >> mysql_num_rows( Connection handle: 1 ) [21:07:04] CMySQLHandler::NumRows() - Returned 7 row(s) [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 ) [21:07:04] CMySQLHandler::FetchRow() - Return: AnceZas|1|1 [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 ) [21:07:04] CMySQLHandler::FetchRow() - Return: Vitalis_Diesel|1|1 [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 ) [21:07:04] CMySQLHandler::FetchRow() - Return: White_Mamba|1|0 [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 ) [21:07:04] CMySQLHandler::FetchRow() - Return: Minde_Gti|1|0 [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 )/it's should end in hear [21:07:04] CMySQLHandler::FetchRow() - Return: AnceZas|1|1// don't have to be here [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 ) [21:07:04] CMySQLHandler::FetchRow() - Return: Vitalis_Diesel|1|1// don't have to be here [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 ) [21:07:04] CMySQLHandler::FetchRow() - Return: Vitalis_Diesel|1|1// don't have to be here [21:07:04] >> mysql_fetch_row_format( Connection handle: 1 ) [21:07:04] >> mysql_free_result( Connection handle: 1 ) [21:07:04] CMySQLHandler::FreeResult() - Result was successfully free'd. |
pawn Код:
if(!strcmp(cmdtext, "/adminai", true))
{
new
Index,
query[ 300 ],
str [ 1200 ];
mysql_query( "SELECT `vardas`,`admin`,`online` FROM `"#MYSQL_TABLE"` WHERE `admin` > '0'" );
mysql_store_result();
if ( mysql_num_rows( ))
{
while( mysql_fetch_row( query ))
{
new
name[ MAX_PLAYER_NAME ],
adminid,
OnlineEx;
sscanf( query, "p<|>s[24]ii", name, adminid, OnlineEx );
if ( !OnlineEx )
{
format( str, 1200, "{FFFFFF}%s%s - {FF0000}OFFLINE\n{FFFFFF}", str, name );
Index++;
}
else
{
format( str, 1200, "{FFFFFF}%s%s - {00FF00}ONLINE\n{FFFFFF}", str, name );
Index++;
}
}
}
mysql_free_result();
if ( !Index )
{
ShowPlayerDialog( playerid, 7, DIALOG_STYLE_MSGBOX, "{FF0000}Administratoriai", "{FF0000}Atsiprasome siuo metu nera isrinktas nei vienas direktorius!", "Gerai", "" );
}
else
{
ShowPlayerDialog( playerid, 8, DIALOG_STYLE_MSGBOX, "{00FF00}Administratoriai", str, "Gerai", "" );
}
return 1;
}