Mysql R8 - loading multiple rows
#4

Take a look at the syntax for the cache_get_row() function.

The first argument is to determine the row to select information from. The second argument is to determine which field to select information from, and obviously, the third is which var to store the information into.

So, if you wanted to do something like "SELECT * FROM `houses`" and load up all of the houses in your database, you need to make a loop. Like this:

pawn Код:
// ...

cache_get_data(rows, fields);

if(rows > 0)
{
    for(new i = 0; i < rows; i++)
    {
        cache_get_row(i, 0, temp);
        // ...
    }
}

// ...
Reply


Messages In This Thread
Mysql R8 - loading multiple rows - by BittleRyan - 11.04.2013, 21:37
Re: Mysql R8 - loading multiple rows - by BittleRyan - 12.04.2013, 20:24
Re: Mysql R8 - loading multiple rows - by BittleRyan - 13.04.2013, 03:20
Re: Mysql R8 - loading multiple rows - by Scenario - 13.04.2013, 03:23
Re: Mysql R8 - loading multiple rows - by BittleRyan - 20.04.2013, 02:26
Re: Mysql R8 - loading multiple rows - by Scenario - 20.04.2013, 03:12
Re: Mysql R8 - loading multiple rows - by BittleRyan - 20.04.2013, 17:09
Re: Mysql R8 - loading multiple rows - by Scenario - 20.04.2013, 17:14
Re: Mysql R8 - loading multiple rows - by BittleRyan - 20.04.2013, 18:00
Re: Mysql R8 - loading multiple rows - by Scenario - 20.04.2013, 18:16

Forum Jump:


Users browsing this thread: 1 Guest(s)