Guten Tag, wir suchen Hilfe mit unserem Selfmade.
Immer wenn die Abfrage ausgeführt wird, stürtzt der Server mit:
Zitat[Wed Mar 20 15:05:27 2013] Function: mysql_query (threaded) executed: "SELECT * FROM autos WHERE besitzer='NAME'' AND laden='1'" with result: "0".
[Wed Mar 20 15:05:27 2013] Function: mysql_query executed: "SELECT * FROM autos WHERE besitzer='NAME' AND laden='1'" with result: "0".
[Wed Mar 20 15:05:27 2013] Function: mysql_store_result executed with result: "1"
stock getPlayerAutos(playerid)
{
new pAutos[128];
new minpAuto;
new maxpAuto;
format(query,sizeof(query),"SELECT id FROM autos WHERE besitzer='%s' AND laden='1' ORDER by id ASC",SpielerName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows()>0)
{
mysql_fetch_field("id",data);
minpAuto=strval(data);
}
else
{
minpAuto=0;
}
mysql_free_result();
format(query,sizeof(query),"SELECT id FROM autos WHERE besitzer='%s' AND laden='1' ORDER by id DESC",SpielerName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows()>0)
{
mysql_fetch_field("id",data);
maxpAuto=strval(data);
}
else
{
maxpAuto=0;
}
mysql_free_result();
for(new i=minpAuto; i<=maxpAuto; i++)
{
format(query,sizeof(query),"SELECT id FROM autos WHERE laden='1' AND id='%i' AND besitzer='%s'",i,SpielerName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows()==1)
{
if(i!=maxpAuto)
{
format(pAutos,sizeof(pAutos),"%s%i,",pAutos,i);
}
else
{
format(pAutos,sizeof(pAutos),"%s%i",pAutos,i);
}
}
mysql_free_result();
}
return pAutos;
}
stock loadPlayerAutos(playerid)
{
format(query,sizeof(query),"SELECT * FROM autos WHERE besitzer='%s' AND laden='1'",SpielerName(playerid));
mysql_query(query,1234,playerid,mysql_car);
return 1;
}