MYSQL Car system dosen't save
#1

Hello again i have a problem. My cars don't save in mySQL database the code:

PHP код:
saveCarToDB(playerid,carid)
{
    new 
query[128];
    
format(querysizeof(query), "INSERT INTO cars (owner,x,y,z,r,model) VALUES ('%i',%f','%f','%f','%f','%i')",iInfo[playerid][db_id],cInfo[carid][c_x],cInfo[carid][c_y],cInfo[carid][c_z],cInfo[carid][c_r],cInfo[carid][model]);
    
mysql_function_query(dbhandel,query,true,"carSaveToDB","i",carid);
    return 
1;

the code to give someone an car:
PHP код:
createPlayerCar(playeridmodelid,Float:xFloat:yFloat:zFloat:r)
{
    for(new 
i=0i<sizeof(cInfo); i++)
    {
        if(
cInfo[i][id_x]!=0)continue;
        
cInfo[i][owner]=iInfo[playerid][db_id];
        
cInfo[i][c_x]=x;
        
cInfo[i][c_y]=y;
        
cInfo[i][c_z]=z;
        
cInfo[i][c_r]=r;
        
cInfo[i][id_x] = CreateVehicle(modelidx,y,z,r, -1, -1, -1);
        
cInfo[i][model] = modelid;
        new 
string[128];
        
format(stringsizeof(string), "Automobil cInfo[%i] je napravljeno!",i);
        print(string);
        
saveCarToDB(playerid,i);
        return 
1;
    }
    return 
1;

and the MYSQL log
PHP код:
[22:08:22] [ERRORCMySQLQuery::Execute[carSaveToDB] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','-1482.304565','5.468750','121.948730','400')' at line 1
[22:08:57] [ERRORCMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='0'' at line 1
[22:12:11] [ERRORCMySQLQuery::Execute[carSaveToDB] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','-2045.110351','59.643882','345.670837','400')' at line 1
[22:12:28] [ERRORCMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='0'' at line 1 
my table
Reply


Messages In This Thread
MYSQL Car system dosen't save - by malackovgfx - 12.06.2015, 20:50
Re: MYSQL Car system dosen't save - by AndySedeyn - 12.06.2015, 21:03
Re: MYSQL Car system dosen't save - by Konstantinos - 12.06.2015, 21:04
Re: MYSQL Car system dosen't save - by malackovgfx - 12.06.2015, 21:05
Re: MYSQL Car system dosen't save - by malackovgfx - 12.06.2015, 21:09
Re: MYSQL Car system dosen't save - by Konstantinos - 12.06.2015, 21:15
Re: MYSQL Car system dosen't save - by malackovgfx - 12.06.2015, 21:23
Re: MYSQL Car system dosen't save - by AndySedeyn - 12.06.2015, 21:27
Re: MYSQL Car system dosen't save - by malackovgfx - 12.06.2015, 21:29

Forum Jump:


Users browsing this thread: 1 Guest(s)