Hallo, ich wollte ein Dynamisches Pickups System erstellen wo man Ingame alles machen kann und es dann in MySQL gespeichert wird.
Es soll vom Script aus eine Tabelle erstellt werden was es aber nicht tut -.-
Hier mal die log:
[14:57:42] [DEBUG] mysql_tquery - connection: 1, query: "CREATE TABLE IF NOT EXISTS `pickups` (`id` int(11) NOT NULL AUTO", callback: "(null)", format: "(null)"[14:57:42] [DEBUG] mysql_tquery - connection: 1, query: "", callback: "(null)", format: "(null)"[14:57:42] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[14:57:42] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[14:57:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "PickupID", connection: 1[14:57:42] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[14:57:42] [WARNING] cache_get_field_content_int - no active cache[14:57:42] [DEBUG] CMySQLConnection::Connect - connection was successful[14:57:42] [DEBUG] CMySQLConnection::Connect - connection was successful[14:57:42] [DEBUG] CMySQLConnection::Connect - connection was successful[14:57:42] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[14:57:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "PickupX", connection: 1[14:57:42] [DEBUG] CMySQLQuery::Execute[] - starting query execution[14:57:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "PickupY", connection: 1[14:57:42] [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 '`PickupWorld` int(11),`Farbcode` int(11),PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAU' at line 1[14:57:42] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
Und hier der Code:
public OnFilterScriptInit()
{
/* print("\n--------------------------------------");
print(" Dynamische Pickups von TVPikachu");
print("--------------------------------------\n");*/
mysql_log(LOG_ALL);
new query[124];
if(mysql_errno() < 1)print("MySQL: Die Verbindung wurde erfolgreich hergestellt."),mysql_log(LOG_ALL); else print("MySQL: Die Verbindung zur MySQL Datenbank konnte nicht hergestellt werden | Der Server wird nun heruntergefahren."), SendRconCommand("exit");
dbhandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
mysql_tquery(dbhandle, "CREATE TABLE IF NOT EXISTS `pickups` (`id` int(11) NOT NULL AUTO_INCREMENT, `AusgangLabel` varchar(24), `EingangLabel` varchar(24), `PickupID` int(11), `PickupX` float(10),`PickupY` float(10),`PickupZ` float(10), `EnterX` float(10),`EnterY` float(10),`EnterZ` float(10),`PickupInt` int(11),,`PickupWorld` int(11),`Farbcode` int(11),PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
mysql_tquery(dbhandle, query);
printf("query: %s", query);
for(new i=0; i<MAX_PICKUPS; i++) {
LoadPickup(i); }
return 1;
}
Mit freundlichen Grüßen