Not creating the vehicle mysql -
pabloalber84 - 08.06.2015
I am creating the script to create vehicle mysql, and create one command, with the next code mysql (All variables has been definided):
PHP код:
new Query[500];
format(Query, sizeof(Query),"INSERT INTO `vehiculos` (`PosX`, `PosY`, `PosZ`) VALUES ('%f', '%f', '%f')", X2, Y2, Z2);
mysql_tquery(Conecction, Query, "CrearVehiculoConceMysql", "ddd", playerid, dealerid, 2);
The problem is: Not create the vehicle.
The callback "CrearVehiculoConceMysql" is the next:
PHP код:
forward CrearVehiculoConceMysql(playerid, dealerid, VehConceID);
In the callback, asign the vehicle variable, and save with mysql:
PHP код:
public CrearVehiculoConceMysql(playerid, dealerid, VehConceID)
{
new id = -1;
VehicleIDMYSQL[id] = cache_insert_id();
id = VehicleIDMYSQL[id];
// ETC etc
return 1;
}
Yes asigned all variables [In the old time, i am creating the code, in other method, and no problem], but now fails to save variables.
Re: Not creating the vehicle mysql -
extender1987 - 08.06.2015
You have to create tables on ''vehiculos''
For example if in your script is MAX_VEHICLES 100 you need to create 100 tables
Respuesta: Re: Not creating the vehicle mysql -
pabloalber84 - 08.06.2015
Quote:
Originally Posted by extender1987
You have to create tables on ''vehiculos''
For example if in your script is MAX_VEHICLES 100 you need to create 100 tables
|
Not is MAX_VEHICLES, and not create 100 tables ._. , i am create the tables with the script, not manually.
Re: Respuesta: Re: Not creating the vehicle mysql -
extender1987 - 08.06.2015
mysql is not working like io_read files .txt ...
you have to create like this INSERT INTO `vehiculos` (`PosX`, `PosY`, `PosZ`
INSERT INTO `vehiculos` (`PosX`, `PosY`, `PosZ`
INSERT INTO `vehiculos` (`PosX`, `PosY`, `PosZ`etc etc in your phpmyadmin SQL
Re: Not creating the vehicle mysql -
Vince - 08.06.2015
Quote:
Originally Posted by extender1987
You have to create tables on ''vehiculos''
For example if in your script is MAX_VEHICLES 100 you need to create 100 tables
|
Are you even serious? No, you don't.
@OP: write code in English if you expect any useful help. It's hard to understand code without context. I can only tell you that this is wrong:
PHP код:
new id = -1;
VehicleIDMYSQL[id] = cache_insert_id();
id = VehicleIDMYSQL[id];
What you're writing is effectively this:
PHP код:
VehicleIDMYSQL[-1] = cache_insert_id();
Which is wrong and will give a runtime error. I don't understand the context so I cannot (won't) give any additional information.