Kód:
<?
$dbserver = "localhost";
$dbuser = "dbuser";
$dbpassword = "dbpassword";
$dbname = "mangosdb";
$dbrealm = "realmdb";
$dbchar = "characters";
$http_password = "";
$link=mysql_pconnect ($dbserver,$dbuser,$dbpassword) or die ("spojenie neuspesne.");
$db = mysql_select_db($dbname, $link) or die ("nepodarilo sa otvorit databazu.");
$action = $_GET['action'];
if ($action == 'get_coords') {
$guid = mysql_escape_string($_GET['guid']);
$query="SELECT position_x,position_y FROM $dbchar.`characters` WHERE guid='".$guid."'";
$result=mysql_query($query, $link) or die ("zly sql dotaz, ziadny vysledok");
$num=mysql_num_rows($result);
$zones=count($zone_name);
$row=mysql_fetch_array($result);
echo $row['position_x'] . "|" . $row['position_y'] . "\n";
} elseif ($action == 'get_ip') {
$guid = mysql_escape_string($_GET['guid']);
$query="SELECT rdb.id,rdb.last_ip FROM $dbrealm.`account` AS rdb INNER JOIN $dbchar.`characters` AS db ON (rdb.id=db.account) WHERE db.guid='".$guid."'";
$result=mysql_query($query, $link) or die ("zly sql dotaz, ziadny vysledok");
$num=mysql_num_rows($result);
$zones=count($zone_name);
$row=mysql_fetch_array($result);
echo $row['id'] . "|" . $row['last_ip'] . "\n";
} else {
$query="SELECT db.name,db.race,db.class,db.map,db.zone,SUBSTRING_INDEX(SUBSTRING_INDEX(db.`data`, ' ', 35), ' ', -1) AS level, SUBSTRING_INDEX(SUBSTRING_INDEX(db.`data`, ' ', 133), ' ', -1) AS gender,position_x,position_y,rdb.gmlevel,db.guid,db2.instance,db4.leaderGuid=db.guid AS leader,rdb.id AS account_id,rdb.last_ip FROM $dbrealm.`account` AS rdb INNER JOIN $dbchar.`characters` AS db ON (rdb.id=db.account) LEFT JOIN $dbchar.`character_instance` AS db2 ON (db.guid=db2.guid) LEFT JOIN $dbchar.`instance` AS db3 ON (db2.instance=db3.id) LEFT JOIN $dbchar.`group_instance` AS db4 ON (db2.instance=db4.instance) WHERE db.online=1";
$result=mysql_query($query, $link) or die ("zly sql dotaz, ziadny vysledok");
$num=mysql_num_rows($result);
$zones=count($zone_name);
while ($row=mysql_fetch_array($result)) {
echo $row['level'] . "|" . $row['name'] . "|" . $row['race'] . "|" . $row['class'] . "|" . $row['map'] . "|" . $row['zone'] . "|" . $row['gmlevel'] . "|" . $row['guid'] . "|" . $row['instance'] . "|" . $row['leader'] . "||\n";
}
}
mysql_free_result($result);
toto my treba vyplnit, vyplnit viem ale tomu chlapikovi mam poslat url adresy rozbehanych nasledovnych PHP scriptov ako rozbehanych scriptov? pls pomozte my nechapem tomu ako rozbehat ten script