Mysql data load???
#1

I have a mysql table that stores some data from the player, but somehow sometimes it does not contain any data from the player ..

I am using mysql R39-6
For this kind of script loading data like this

Код:
New querys [128];
Mysql_format (mysqlcon, querys, sizeof (querys), "SELECT * FROM cars WHERE ownerid = '% d'", pInfo [playerid] [pMysqlID]);
Mysql_tquery (mysqlcon, querys, "accountOnLoadVehicle", "d", extraid);
And for response

Код:
Forward accountOnLoadVehicle (extraid);
Public accountOnLoadVehicle (extraid) {
New rows, fields;
Cache_get_data (rows, fields);
If (rows) {
For (new i; i <rows; i ++) {
New id = cache_get_field_content_int (i, "slot", mysqlcon);
New ids = cache_get_field_content_int (i, "ps", mysqlcon);

Bla ... bla..bla ....
**}
}
Return 1;
}
The table is the loading system with the result data loop using the slot of the vehicle for the index

Is there any error in loading the data ??

NB: That's only 1 table, in the script there are 5 similar tables that are loaded once

Thanks in advance... sorry for my bad english
Reply
#2

Maybe don't use space here ( '% d' ) in your mysql_format

PHP код:
forward accountOnLoadVehicle (extraid);
public 
accountOnLoadVehicle (extraid) {
    if (
cache_num_rows() > 0) {
        new 
id cache_get_field_content_int (0"slot"mysqlcon);
        new 
ids cache_get_field_content_int (0"ps"mysqlcon);
    }
    return 
1;

Stop using uppercase for ducking standard notations. They are write with lowercase for a ducking reason.
Reply
#3

Plus; do not use ' ' unless it's a string.
Reply
#4

Thanks for reply..

Sorry it's must be '%d'

and ' ' that for using mysql query not for string

It can load normally, but sometimes can't load
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)