Run time error 7: "Stack underflow"
#3

pawn Code:
mysql_fetch_field_row(PickupInfo[idx][puMessage], "message");
There's no need to strmid it.

pawn Code:
stock LoadSQLPickups()
{
    new
        x,
        totalPickups,
        resultString[64]; // Increase if needed.

    mysql_query("SELECT * FROM pickups");
    mysql_store_result();
   
    totalPickups = mysql_num_rows();
   
    while(mysql_retrieve_row()) {
        mysql_get_field("id", result);
        x = strval(result);
       
        mysql_get_field("message", PickupInfo[x][puMessage]);
       
        mysql_get_field("type", result);
        PickupInfo[x][puType] = strval(result);
       
        mysql_get_field("model", result);
        PickupInfo[idx][puModel] = strval(result);
       
        mysql_get_field("x", result);
        PickupInfo[idx][puX] = floatstr(result);
       
        mysql_get_field("y", result);
        PickupInfo[idx][puY] = floatstr(result);
       
        mysql_get_field("z", result);
        PickupInfo[idx][puZ] = floatstr(result);
       
        CreatePickup(PickupInfo[x][puModel], PickupInfo[x][puType], PickupInfo[x][puX], PickupInfo[x][puY], PickupInfo[x][puZ]);
    }
   
    mysql_free_result();
   
    return printf("%d pickups loaded from DB", totalPickups);
}
Reply


Messages In This Thread
Run time error 7: "Stack underflow" - by Coicatak - 25.09.2009, 17:18
Re: Run time error 7: "Stack underflow" - by Logitech3334 - 05.09.2010, 07:25
Re: Run time error 7: "Stack underflow" - by Calgon - 05.09.2010, 07:32
Re: Run time error 7: "Stack underflow" - by Simon - 05.09.2010, 07:44
Re: Run time error 7: "Stack underflow" - by Calgon - 05.09.2010, 07:54

Forum Jump:


Users browsing this thread: 1 Guest(s)