<?php

require_once("connect.inc.php");
header('Content-Type: text/xml');

function getCharPos( $id )
{
	global $connexion;
	
	$req = 'SELECT char_pos[0] AS x, char_pos[1] AS y FROM characters WHERE char_id='.$id;
	$res = pg_query($connexion, $req) or die( pg_last_error().'<br />'.$req );
	
	$xml  = '<x>'.pg_fetch_result($res,0,'x').'</x>';
	$xml .= '<y>'.pg_fetch_result($res,0,'y').'</y>';
	
	echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><xml>'.$xml.'</xml>';
}
getCharPos( $_GET['id'] );
?>