[HELP] Mysql Data loading
#1

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 код:
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
Код:
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.
Reply
#2

Strange. I don't know why it would do that. It does print the correct amount of rows? It's probably going to be something painfully obvious but I'm not seeing it. Try using a variable that doesn't start with an underscore, though. The underscore, like the @-symbol which declares a function/variable as public, may have a special meaning when used as the first character of an identifier.
Reply
#3

Still the same tho,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)