not send the query in ongamemodeinit
#1

hi, friends.

i have a problem, the problem is I am sending a query, but this is not sent.

pawn Код:
mysql_query(MySQL,"SELECT * FROM svr_rangos");
    new cont_dat;
    while(cont_dat < cache_num_rows())
    {
        infRango[cont_dat][ID] = cache_get_field_content_int(cont_dat,"rangID");
        infRango[cont_dat][Propiedad] = cache_get_field_content_int(cont_dat,"rangPropiedad");
        cache_get_field_content(cont_dat,"rangNom_ES",infRango[cont_dat][NombreES]);
        cache_get_field_content(cont_dat,"rangNom_ING",infRango[cont_dat][NombreING]);
        infRango[cont_dat][MinEXP] = cache_get_field_content_int(cont_dat,"rangExp_min");
        cont_dat++;
    }
    cant_Rangos=cont_dat;
    new query[64];
    cache_get_query_string(query);
    printf("Executed query: \"%s\"", query);
    printf("Rangos Totales: %d",cant_Rangos);
result from cache_get_query_string is ""
Reply
#2

Solved, the problem was that sent the query before connecting to the database.
Reply
#3

You're going to have problems with memory leaks because you never delete the result (which you never store in the first place).

Other than that, I want to say 2 more things. You keep calling cache_num_rows for each iteration, store it to a variable to avoid that and use threaded queries.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)