MYSQL
#7

It does not move to next row (as in SQLite) by itself so the `while` loop would be same as `for`.
pawn Код:
new i = 0, rows = cache_num_rows();

while (i < rows)
{
    // cache functions

    i++;
}
pawn Код:
for (new i = 0, rows = cache_num_rows(); i < rows; i++)
{
    // cache functions
}
I noticed something that it is very weird. Why do you save cache, set active cache and delete cache? Threaded queries do this on their own. Remove it altogether.

About your method, an INSERT INTO .. ON DUPLICATE is better. If you can provide more details about your tables and what you are trying to do by checking if the object has been saved or not, we can fix it.
Reply


Messages In This Thread
MYSQL (edited reply) - by v1k1nG - 08.10.2018, 09:38
Re: MYSQL - by Calisthenics - 08.10.2018, 10:14
Re: MYSQL - by v1k1nG - 08.10.2018, 11:10
Re: MYSQL - by v1k1nG - 08.10.2018, 12:43
Re: MYSQL - by v1k1nG - 08.10.2018, 13:48
Re: MYSQL - by v1k1nG - 08.10.2018, 14:01
Re: MYSQL - by Calisthenics - 08.10.2018, 18:32
Re: MYSQL - by v1k1nG - 08.10.2018, 18:58
Re: MYSQL - by Calisthenics - 08.10.2018, 20:40
Re: MYSQL - by v1k1nG - 10.10.2018, 12:10

Forum Jump:


Users browsing this thread: 7 Guest(s)