Ich bin grade dabei ein eigenes PvP-Ranking zu erstellen.
Die PHP dafür hab ich bereits funtionstüchtig fertig.
Jedoch funzt meine mysql funktion nicht richtig...
Code:
local spielerid= pc.get_player_id()
local update_kill_rot = mysql_query("UPDATE player.player SET red_kill="..pc.getqf("empire1").." WHERE id="..spielerid.."")
Code:
mysql: ambiguous option '--e=UPDATE player.player SET red_kill=6 WHERE id=57976' (enable_cleartext_plugin, execute)
ID und Killanzahl liest er wunderbar aus.
Nur setzt er die spalte dort nicht auf 6 wie es im Befehl steht.
Zeig mir mal deine mysql_query function. Ich glaube ich kenne den Fehler.
Code:
--[[
@name mysql_query
@author Mijago
@needs split
@descr
Mysql-Funktion der neuesten Generation.
--]]
mysql_query = function(query)
if not pre then
local rt = io.open('CONFIG','r'):read('*all')
pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')
end
math.randomseed(os.time())
local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi)
for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi);
for i = 2, table.getn(t) do table.foreach(t[i],function(a,b)
out[i-1] = out[i-1] or {}
out[i-1][a] = tonumber(b) or b or 'NULL'
out[t[1][a]] = out[t[1][a]] or {}
out[t[1][a]][i-1] = tonumber(b) or b or 'NULL'
end) end
out.__lines = t[1]
return out
end
--[[
@name mysql_query
@author Mijago
@needs split
@descr
Mysql-Funktion der neuesten Generation.
--]]
mysql_query = function(query)
if not pre then
local rt = io.open('CONFIG','r'):read('*all')
pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')
end
math.randomseed(os.time())
local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi)
for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi);
for i = 2, table.getn(t) do table.foreach(t[i],function(a,b)
out[i-1] = out[i-1] or {}
out[i-1][a] = tonumber(b) or b or 'NULL'
out[t[1][a]] = out[t[1][a]] or {}
out[t[1][a]][i-1] = tonumber(b) or b or 'NULL'
end) end
out.__lines = t[1]
return out
end
Ganz normale von Mijago halt
Änder das --e=" in -e" dann sollte es wieder funktionieren.
Mysql Query. 10/20/2012 - Metin2 Private Server - 0 Replies Hey Com.
Ich suche eine Mysql Query die bestimmte Eiinträge aus der quest.sql löscht.
MfG
Mysql Query. 10/12/2012 - Metin2 Private Server - 7 Replies Hey Com.
Ich suche eine query die alle Einträge: costume_system sucht und löscht aus meiner quest.sql
MySQL Query 10/10/2012 - Metin2 Private Server - 2 Replies Hey COM.
Ich suche eine Query die die Coins von einem Account auf 5000 setzt.
Ein andere User hat auch danach gefragt, aber keine Antwort bekommen
PHP-Mysql _ query 06/08/2012 - Web Development - 0 Replies Hallo meine frage/problem wie kriege ich es hin das diese anfragen mit einem query abgesendet werden?
$eintrag = "INSERT INTO lions_aateilnahme
(Event,Freund,Personen,EssenFleisch, EssenFisch,EssenVeg,Kommen,Bemerkung)
VALUES
('$id','$name', '$teilnehmer','$norm', '$fisch','$veg','$kommen','$bemerkung')";
$eintragen = mysql_query($eintrag);
if(!empty($int)){
$intt= "INSERT INTO lions_aateilnahme (IntAntwort1) VALUES('$int')";
$eintragen = mysql_query($intt);
PHP/MySQL Help - Is this MySQL Query correct? 09/23/2011 - CO2 Programming - 1 Replies $rank = mysql_query("SELECT Name,Level,Class,Online FROM entities ORDER BY Level DESC LIMIT $limit");
I'm pretty sure that is right... whenever I do
while ($row = mysql_fetch_array($rank)) { ... }
It always gives me a mysql_fetch_array error. I've checked and the database is populated, the columns exist, so what could be the issue?