Unable to load pickups from mysql
#1

Can somebody tell me what seems to be wrong with this query?

PHP код:
public LoadPickups(playerid)
{
    new 
query[1000], savingstring[1000];
    new 
Float:x,Float:y,Float:z;
    
format(querysizeof(query), "SELECT * FROM Pickups");
    
mysql_query(query);
    
mysql_store_result();
    while(
mysql_fetch_row_format(query,"|"))
    {
        
mysql_fetch_field_row(savingstring"PickupID"); PickupInfo[PickupID] = strval(savingstring);
        
mysql_fetch_field_row(savingstring"ID"); PickupInfo[IDz] = strval(savingstring);
        
mysql_fetch_field_row(savingstring"Type");  PickupInfo[Type] = strval(savingstring);
        
mysql_fetch_field_row(savingstring"X");     PickupInfo[X] = floatstr(savingstring);
        
mysql_fetch_field_row(savingstring"Y");     PickupInfo[Y] = floatstr(savingstring);
        
mysql_fetch_field_row(savingstring"Z"); PickupInfo[Z] = floatstr(savingstring);
        
mysql_free_result();
    }
    return 
1;

Doesn't wanna load my floats.


EDIT: Nevermind, Fixed.
Reply
#2

Why would you need this...

mysql_fetch_field_row(savingstring, "PickupID"); PickupInfo[PickupID] = strval(savingstring);

That will get set once you create your pickup.
Reply
#3

It's so that it is already loaded and so that i don't have to assign it some where else. It keeps it cleaner.

My mistake was my a loop. This loads perfectly fine.

PS: Next time instead of trying to raise your post count with ridiculous posts may you please actually help people out. If you don't have a response that will help someone just don't respond.

Please and thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)