15.01.2014, 12:21
Hi,
I want to save informations then load them after.
The save system work. But I can't load them, I don't know why.
I did this:
But it doesn't work...
This is what I want:
I save in the database informations, then I load them to use them after.
In server log:
So it doesnt load informations.
mysql logs:
I can see that there's an error but I don't know how to solve it.
You got an idea please ?
Thank you.
I want to save informations then load them after.
The save system work. But I can't load them, I don't know why.
I did this:
Код:
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `joueurs` WHERE `posX` = '%f', `posY` = '%f' AND `posZ` = '%f' WHERE `Name` = '%s' ", pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ], Name[playerid]); mysql_tquery(mysql, query, "", ""); printf("\n %s", query); // printing to make sure the co-ords are being sent. );
This is what I want:
I save in the database informations, then I load them to use them after.
Код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO `joueurs` (`Username`, `Password`, `IP`, `Admin`, `VIP`, `Argent`, `posX` ,`posY`, `posZ`, `Interieur`, `World`, `Skin`, `Niveau`) VALUES ('%e', '%s', '%s', 0, 0, 1000, 1527.5634, -1738.9218, 13.5469, 0, 0, 26, 1)", Name[playerid], pInfo[playerid][Password], IP[playerid]); mysql_tquery(mysql, query, "", ""); mysql_format(mysql, query, sizeof(query), "SELECT * FROM `joueurs` WHERE `posX` = '%f', `posY` = '%f' AND `posZ` = '%f' WHERE `Name` = '%s' ", pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ], Name[playerid]); mysql_tquery(mysql, query, "", ""); printf("\n %s", query); // printing to make sure the co-ords are being sent. );
In server log:
Код:
SELECT * FROM `joueurs` WHERE `posX` = '0.000000', `posY` = '0.000000' AND `posZ` = '0.000000' WHERE `Name` = 'Belabbas_Anis' [23:06:18] 0.000000 0.000000
mysql logs:
Код:
[23:06:18] [DEBUG] mysql_format - connection: 1, len: 1024, format: "INSERT INTO `joueurs` (`Username`, `Password`, `IP`, `Admin`, `VIP`, `Argent`, `posX` ,`posY`, `posZ`, `Interieur`, `World`, `Sk..." [23:06:18] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `joueurs` (`Username`, `Password`, `IP`, `Admin`, `V", callback: "(null)", format: "(null)" [23:06:18] [DEBUG] mysql_format - connection: 1, len: 1024, format: "SELECT * FROM `joueurs` WHERE `posX` = '%f', `posY` = '%f' AND `posZ` = '%f' WHERE `Name` = '%s' " [23:06:18] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `joueurs` WHERE `posX` = '0.000000', `posY` = '0.0", callback: "(null)", format: "(null)" [23:06:18] [DEBUG] CMySQLQuery::Execute[] - starting query execution [23:06:18] [DEBUG] CMySQLQuery::Execute[] - query was successful [23:06:18] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving [23:06:18] [DEBUG] CMySQLQuery::Execute[] - starting query execution [23:06:18] [ERROR] CMySQLQuery::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 ' `posY` = '0.000000' AND `posZ` = '0.000000' WHERE `Name` = 'Belabbas_Anis'' at line 1
You got an idea please ?
Thank you.