mysql_query error, HELP PLS
#1

Код:
public AutoSaveVehicles()
{
    //new Query[400];
    new save[400];
    for(new id; id < MAX_CARS; id++)
    {
		new Float:health;
  		GetVehicleHealth(id, health);
  		Vehicles[id][Damage] = floatround(health);
        format(save, sizeof(save), "UPDATE Vehicles SET Fuel = %d, Damage = %d WHERE SQLID = %d",

									Vehicles[id][Fuel],
									Vehicles[id][Damage],
									id);
		mysql_query(save);
    }
	return 1;
}
Error Code:
Код:
error 035: argument type mismatch (argument 1)
Help me pls, i dont have good idea :/
Reply
#2

What line is the error on? Aslo, show me your Vehicled enum
Reply
#3

You need to put the mysql connection.
pawn Код:
new mysql;

public OnGameModeInit()
{
    mysql = mysql_connect(<your_host>, <your_user>, <your_db>, <your_password>);
    return 1;
}

public AutoSaveVehicles()
{
    //new Query[400];
    new save[400];
    for(new id; id < MAX_CARS; id++)
    {
        new Float:health;
        GetVehicleHealth(id, health);
        Vehicles[id][Damage] = floatround(health);
        format(save, sizeof(save), "UPDATE Vehicles SET Fuel = %d, Damage = %d WHERE SQLID = %d",Vehicles[id][Fuel],Vehicles[id][Damage],id);
        mysql_query(mysql, save);
    }
    return 1;
}
Reply
#4

Not only this lines, lot of error
Код:
error 035: argument type mismatch (argument 1)
..

But, I write : #include <mysql> , its the problem is solved , but don't save accounts,vehicles ...
Reply
#5

Код:
 MySQLConnect()
{
	
	mysql_connect("localhost", "testsamp", "testsamp", "asdasd");
    mysql_debug(1);
    if(mysql_ping()) print("MySQL connection is alive!");
    if(!mysql_ping()) print("MySQL connection failed.");
    return 1;
}
Have mysql connect...
Reply
#6

Your code seems to be written in an older version of MySQL plugin. R6 or older. Find and download R6, both the include and plugin.
Reply
#7

I download R6 plugin version. Don't have error, but don't save accounts WHY?
Reply
#8

Mysql connection failed... why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)