05.01.2015, 18:08
I can't get this to save properly:
Код:
format(query, sizeof(query), "INSERT INTO accounts (`name`, `password`, `posx`, `posy`, `posz`, `posa`, `int`, `vw`, `admin`, `adminduty`, `operator`, `skin`, `banned`, `faction`, `rank` , `housekey`, `minutes` , `hours`, `paycheck`, `earnings`, `bank`, `money`) VALUES ('%s', '%s', '1642.2334', '-2240.4983', '13.4952', '90', '0', '0', '0', '0', '0', '26', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')", GetName(playerid), epass); mysql_query(query);
PHP код:
[19:48:10] >> mysql_query( Connection handle: 1 )
[19:48:10] CMySQLHandler::Query(SELECT * FROM accounts WHERE name = 'Anthony Consalvr') - Successfully executed.
[19:48:10] >> mysql_store_result( Connection handle: 1 )
[19:48:10] CMySQLHandler::StoreResult() - Result was stored.
[19:48:10] >> mysql_num_rows( Connection handle: 1 )
[19:48:10] CMySQLHandler::NumRows() - Returned 0 row(s)
[19:48:11] >> mysql_query( Connection handle: 1 )
[19:48:11] CMySQLHandler::Query(INSERT INTO accounts (`name`, `password`, `posx`, `posy`, `posz`, `posa`, `int`, `vw`, `admin`, `adminduty`, `operator`, `skin`, `banned`, `faction`, `rank` , `housekey`, `minutes` , `hours`, `paycheck`, `earnings`, `bank`, `money`) VALUES ('Anthony Consalvr', 'EB49585A635A8AC88622F9203EE2B921C2E5DBF8DCEBCC28877811309F94CEE20624D9B85EBAB13116AD7F9E3EFF451D11B55148A0F8B67A78219A00C406ACF9', '1642.2334', '-2240.4983', '13.4952', '90', '0', '0', '0', '0', '0', '26', '0', '0', '0', '0', '0', '0', ') - An error has occured. (Error ID: 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 ''' at line 1)
[19:48:11] >> mysql_query( Connection handle: 1 )
[19:48:11] CMySQLHandler::Query(SELECT * FROM accounts WHERE name = 'Anthony Consalvr') - Successfully executed.
[19:48:11] >> mysql_store_result( Connection handle: 1 )
[19:48:11] CMySQLHandler::StoreResult() - Result was stored.
[19:48:11] >> mysql_fetch_row_format( Connection handle: 1 )
[19:48:11] >> mysql_free_result( Connection handle: 1 )
[19:48:11] CMySQLHandler::FreeResult() - Result was successfully free'd.
[19:48:18] >> mysql_query( Connection handle: 1 )
[19:48:18] CMySQLHandler::Query(UPDATE accounts SET `name` = 'Anthony Consalvr', `posx` = '132.000000', `posy` = '-67.456321', `posz` = '1.578125', `posa` = '0.000000', `int` = '0', `vw` = '0', `admin` = '0', `adminduty` = '0', `operator` = '0', `skin` = '0', `banned` = '0', `faction` = '0', `rank` = '0', `housekey` = '0', `minutes` = '0', `hours` = '0', `paycheck` = '0', `earnings` = '0', `bank` = '0', `money` = '0' WHERE `name` = 'Anthony Consalvr') - Successfully executed.