i am trying to load a variable through php from a sql database but i get nothing
here is the code
var Idfield;
var loader:URLLoader = new URLLoader();
// data will come as URL encoded variables
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(new URLRequest("pull.php"));
loader.addEventListener(Event.COMPLETE,dataload);
function dataload(e:Event){
Idfield =e.target.data["id"];
trace(Idfield);
}
here is the php code
$query = "SELECT max(id) from $tablename";
$result = mysql_query($query)
or die("no rows selected");
$row = mysql_fetch_row($result); // extracts one row
echo "id=$row[0]";