Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

[HELP] Mysql Data loading

$
0
0
Hello there, hope you're doing great,
So, I'm trying to load few things from a table `Strg`, I have, for example, 2 rows, but only the first row loads, leaving the second ignored for some reason.

PHP Code:

LoadDataEx()
{
    
mysql_tquery(handle"SELECT * FROM `Strg`""SQL_LoadDataEx");

    return 
1;
}

forward SQL_LoadDataEx();
public 
SQL_LoadDataEx()
{
    new 
rows cache_num_rows(), _id;

    if(
rows)
    {
        
printf("Rows: %d"rows);
        for(new 
Qr 0Qr!=rowsQr++)
        {    
            
cache_get_value_name_int(Qr"ID"_id);

            
printf("Iterator: %d | ID: %d"Qr_id);
        }
    }

    return 
1;


This is what should be loaded from the table


This is what prints out
Code:

Rows: 2
Iterator: 0 | ID: 0
Iterator: 1 | ID: 0

I tried different loops, experimented with lots of things, but it still loads only one row, interestingly, when I skip over the first row for(new Qr = 1; Qr!=rows; Qr++), the second-row loads and vice versa.
I honestly don't know what could be the problem here, just for the record, I'm using MySQL R41-3.

Note: I don't know if this plays any factor in this at all, but the `ID` field is not auto incremented.

I hope someone could provide help, thanks in advance.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>