MySQL string to variable
#24

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Im using a loop to load every vehicle, by calling the function in the loop

Anyways, ive tried to make the variable larger, didnt work. Tried to make it to 24, 25, 26 and 50; neither one of those worked
There is one simple way to loop through all the data..i don't know if it's faster or slower.. but i use it.
That's how i load my stuff..and it all loads perfectly.

pawn Код:
new TotalThings;

mysql_function_query(g_Handle, "SELECT * FROM table", true, "Loadthings","");

forward Loadthings();
public Loadthings() {
    new rows,fields,temp[64];
    cache_get_data(rows,fields);
    while(TotalThings < rows) {
        cache_get_row(TotalThings, 0, temp), eNum[TotalThings][eID] = strval(temp);
        cache_get_row(TotalThings, 1, temp), format(eNum[TotalThings][eName],sizeof(temp),temp);
        TotalThings++;
    }
}
If you are using r18 or whatever.. maybe there's a function that retrieves the string directly.. idk. haven't checked. i use r14 and i usually use cache_get_row for everything.

//Are you sure idx 1 is the owner name ?
// 0 - id
// 1 - owner
// 2 - etc.
Reply


Messages In This Thread
MySQL string to variable - by Wesley221 - 29.04.2013, 18:17
Re: MySQL string to variable - by MP2 - 30.04.2013, 08:33
Re: MySQL string to variable - by AndreT - 30.04.2013, 08:51
Re: MySQL string to variable - by MP2 - 30.04.2013, 08:53
Re: MySQL string to variable - by AndreT - 30.04.2013, 10:19
Re: MySQL string to variable - by MP2 - 30.04.2013, 10:42
Re: MySQL string to variable - by AndreT - 30.04.2013, 12:30
Re: MySQL string to variable - by MP2 - 30.04.2013, 12:37
Re: MySQL string to variable - by Wesley221 - 30.04.2013, 13:48
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 15:24
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:07
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:13
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:19
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:24
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:28
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:35
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:48
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 19:37
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 17:43
Re: MySQL string to variable - by Scenario - 03.05.2013, 17:51
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 19:32
Re: MySQL string to variable - by InfiniTy. - 03.05.2013, 19:41
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 20:32
Re: MySQL string to variable - by InfiniTy. - 03.05.2013, 20:51
Re: MySQL string to variable - by Wesley221 - 04.05.2013, 13:54
Re: MySQL string to variable - by InfiniTy. - 04.05.2013, 14:39
Re: MySQL string to variable - by Wesley221 - 04.05.2013, 15:13
Re: MySQL string to variable - by Wesley221 - 05.05.2013, 14:16

Forum Jump:


Users browsing this thread: 3 Guest(s)