rowcount check

This commit is contained in:
jenzur 2020-04-14 01:06:36 +02:00
parent ef103951d2
commit 8f064c9e40

View File

@ -411,13 +411,16 @@ public void mysql_enable_disable_poll(int iclient6, char []table_name_enable)
delete rs_disable; delete rs_disable;
return; return;
} }
rs_disable.FetchRow(); if (rs_disable.RowCount > 0)
int status = rs_disable.FetchInt(0); {
delete rs_disable; rs_disable.FetchRow();
if (status) int status = rs_disable.FetchInt(0);
PrintToChat(iclient6, "Enabled poll %s", table_name_enable); delete rs_disable;
else if (status)
PrintToChat(iclient6, "Disabled poll %s", table_name_enable); PrintToChat(iclient6, "Enabled poll %s", table_name_enable);
else
PrintToChat(iclient6, "Disabled poll %s", table_name_enable);
}
editpoll(iclient6, table_name_enable); editpoll(iclient6, table_name_enable);
} }
@ -687,22 +690,25 @@ public void mysql_playtime_requirement(int client, char []info)
delete rs; delete rs;
return; return;
} }
int playtime; if (rs.RowCount > 0)
rs.FetchRow(); {
playtime = rs.FetchInt(0); int playtime;
PrintToChat(client, "playtime required: %i", playtime); rs.FetchRow();
admin_editing[client] = 7; playtime = rs.FetchInt(0);
Menu menu = new Menu(editpollmenu, MENU_ACTIONS_ALL); PrintToChat(client, "playtime required: %i", playtime);
menu.SetTitle("Poll %s has playtime requirement: %i", "", info, playtime); admin_editing[client] = 7;
menu.AddItem("0", "0 hours playtime requirement"); Menu menu = new Menu(editpollmenu, MENU_ACTIONS_ALL);
menu.AddItem("5", "5 hours playtime requirement"); menu.SetTitle("Poll %s has playtime requirement: %i", "", info, playtime);
menu.AddItem("10", "10 hours playtime requirement"); menu.AddItem("0", "0 hours playtime requirement");
menu.AddItem("25", "25 hours playtime requirement"); menu.AddItem("5", "5 hours playtime requirement");
menu.AddItem("50", "50 hours playtime requirement"); menu.AddItem("10", "10 hours playtime requirement");
menu.AddItem("250", "250 hours playtime requirement"); menu.AddItem("25", "25 hours playtime requirement");
menu.AddItem("1000", "1000 hours playtime requirement"); menu.AddItem("50", "50 hours playtime requirement");
menu.ExitButton = true; menu.AddItem("250", "250 hours playtime requirement");
menu.Display(client, MENU_TIME_FOREVER); menu.AddItem("1000", "1000 hours playtime requirement");
menu.ExitButton = true;
menu.Display(client, MENU_TIME_FOREVER);
}
delete rs; delete rs;
} }