Problem(error/warning): Necuva mi pumpe koje priram u databazu
Deo skripte: [pawn]protected mSQL_CreateFuelStation( createID )
{
static q[400];
mysql_format( mSQL, q, sizeof( q ),
"INSERT INTO `fuel_stations` ( fsBussinesID, fsFuelPrice, fsPos1, fsPos2, fsPos3 ) \
VALUES( '%d', '%d', '%d', '%d', '%d', '%f', '%f', '%f' )",
FuelStation[ createID ][ fsBussinesID ], FuelStation[ createID ][ fsFuelPrice ], FuelStation[ createID ][ fsPos ][ 0 ], FuelStation[ createID ][ fsPos ][ 1 ], FuelStation[ createID ][ fsPos ][ 2 ] );
mysql_tquery( mSQL, q, "OnFuelStationCreated", "i", createID );
return(true);
}
protected OnFuelStationCreated( createID )
{
FuelStation[ createID ][ fsSQLID ] = cache_insert_id();
return(true);
}[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [11:20:02 10/22/21] [ERROR] mysql_format - no value for specifier "%f" available
[11:20:02 10/22/21] [ERROR] mysql_format - no value for specifier "%f" available
[11:20:02 10/22/21] [ERROR] mysql_format - no value for specifier "%f" available
[11:20:02 10/22/21] [ERROR] CMySQLQuery::Execute[OnFuelStationCreated] - (error #1136) Column count doesn't match value count at row 1 (Query: "INSERT INTO `fuel_stations` ( fsBussinesID, fsFuelPrice, fsPos1, fsPos2, fsPos3 ) VALUES( '7', '2', '1148904002', '-999769157', '1110002024', '', '', '' )")
Imas imenovnih 5 polja, a unosis 8 vrijednosti
Probaj ovako
[pawn]"INSERT INTO `fuel_stations` ( fsBussinesID, fsFuelPrice, fsPos1, fsPos2, fsPos3 ) \
VALUES( `%d`, `%d`, `%f`, `%f`, `%f`)"[/pawn]