17.02.2012, 12:54
Hello, well i have a table in database name `suggestion`. Anyway, i wanna check who suggested but anytime when i try the command, it insets me a new row with my name and in suggestion nothing.
PHP код:
CMD:checksuggestion( playerid, params[] )
{
new Query[700], name[24], suggestion[200], string[1000], aux[1000];
format(Query, sizeof(Query), "SELECT * FROM `suggestions`");
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
while(mysql_fetch_row(Query))
{
mysql_fetch_field_row(name, "user");
mysql_fetch_field_row(suggestion, "suggestion");
format(aux, sizeof(aux), "{00FF00}User: {FFFFFF}%s\t\t{00FF00}Suggestion: {FFFFFF}%s\n", name, suggestion);
strcat(string, aux);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "{FFFFFF}Suggestion List", string, "Ok","");
}
}
mysql_free_result();
return 1;
}