Hallo,
ich habe heute mitnem Projektpartner/Kumpel zsm. eine MySQL Abfrage gemacht. Leider stürzt der Server bei der Abfrage ohne jegliche Hinweise auf Fehler ab.
Der Stock mit der Abfrage:
Spawn_Vehicles()
{
mysql_query("SELECT * FROM `vehiles`");
mysql_store_result();
print("Test before While");
while(mysql_retrieve_row())
{
print("Test in While");
new modelid[128];
print("Test after new modelid[128];");
new posx[128];
print("Test after new posx[128];");
new posy[128];
print("Test after new posy[128];");
new posz[128];
print("Test after new posz[128];");
new posa[128];
print("Test after new posa[128];");
new errno[128];
format(errno, sizeof(errno), "%i", mysql_errno());
print(errno);
mysql_fetch_field(1, modelid);
print("Test after mysql_fetch_field(1, modelid);");
mysql_fetch_field(2, posx);
print("Test after mysql_fetch_field(2, posx);");
mysql_fetch_field(3, posy);
print("Test after mysql_fetch_field(3, posy);");
mysql_fetch_field(4, posz);
print("Test after mysql_fetch_field(4, posz);");
mysql_fetch_field(5, posa);
print("Test after mysql_fetch_field(5, posa);");
new test[128];
format(test, sizeof(test), "ModelID: %s", modelid);
SendClientMessageToAll(0xFFFFFFFF, test);
format(test, sizeof(test), "posx: %s", posx);
SendClientMessageToAll(0xFFFFFFFF, test);
format(test, sizeof(test), "posy: %s", posy);
SendClientMessageToAll(0xFFFFFFFF, test);
format(test, sizeof(test), "posz: %s", posz);
SendClientMessageToAll(0xFFFFFFFF, test);
format(test, sizeof(test), "posa: %s", posa);
SendClientMessageToAll(0xFFFFFFFF, test);
print("Test by the end of While");
break;
}
mysql_free_result();
return 1;
}
Hier wird der Stock aufgerufen:
Spawn_Vehicles();
In der Log:
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3e, (C)2005-2012 SA-MP Team
[16:13:45]
[16:13:45] Server Plugins
[16:13:45] --------------
[16:13:45] Loading plugin: mysql.so
[16:13:45]
> MySQL plugin R5 successfully loaded.
[16:13:45] Loaded.
[16:13:45] Loaded 1 plugins.
[16:13:45]
[16:13:45] Ban list
[16:13:45] --------
[16:13:45] Loaded: samp.ban
[16:13:45]
[16:13:45]
[16:13:45] Filterscripts
[16:13:45] ---------------
[16:13:45] Loading filterscript 'cameditor.amx'...
[16:13:45]
--------------------------------------
[16:13:45] CamEditor by Drebin
[16:13:45] --------------------------------------
[16:13:45] Loaded 1 filterscripts.
[16:13:45] <-| [MYSQL] Verbindung zur Datenbank wurde erfolgreich hergestellt!
[16:13:45]
----------------------------------
[16:13:45] Galaxy Reallife
[16:13:45] ----------------------------------
[16:13:45] Number of vehicle models: 0
[16:13:58] Incoming connection: 91.97.4.160:54592
[16:13:59] [join] CheezeStickz has joined the server (0:91.97.4.160)
[16:14:09] Test before While
[16:14:09] Test in While
[16:14:09] Test after new modelid[128];
[16:14:09] Test after new posx[128];
[16:14:09] Test after new posy[128];
[16:14:09] Test after new posz[128];
[16:14:09] Test after new posa[128];
[16:14:09] 0
Bitte um hilfe.
Danke!
P.s. Ich hab noch nie was in MySQL gemacht, also selber, ich habs mir selbst zusammen geschraubt, mit etwas hilfe von meinem Projektpartner/Kumpel.
mfg
Sonderzeichen