I'm trying to read some mySQL data into Flash using an XML file written in PHP.
I'm getting a status -9 error in Flash (close tag not matched with an end tag).
Can anybody tell what's wrong with my code?
<?
function Question() {
MySQL_connect("localhost","","");
MySQL_select_db('database01');
$res = MySQL_query("select QuID from Questions");
$WhichRow = rand(0,MySQL_num_rows($res) - 1);
$WhichQuid = MySQL_result($res,$WhichRow,0);
$res = MySQL_query("select from Questions where QuID = $WhichQuid");
$sqlquestion = MySQL_fetch_array($res);
$sqlQuid = $sqlquestion["QuID"];
$this->Q = $sqlquestion["Q"];
$this->idkey = $sqlquestion["QuID"];
MySQL_free_result($res);
$res = MySQL_query("select from Answers where WhichQuestion = $sqlQuid");
$numrows = MySQL_num_rows($res);
for ($i = 0; $i < $numrows; $i++) {
$temp = MySQL_fetch_array($res);
array_push($this->A, $temp["A"]);
}
return $this;
}
function qzml() {
if (!$beenhere++) {
echo('<?xml version="1.0"?>'."\r\n");
echo('<Question UIN = "'.$this->idkey.'">'."\r\n");
echo('<Q>'.$this->Q. '</Q>'."\r\n");
while (list($n, $answer) = each($this->A)) {
echo('<A>'.$answer.'</A>'."\r\n");
}
echo('</Question>'."\r\n");
}
}
$rand(microtime()*1000000); // seed random number generator
$q = new Question (rand(0,5)); // create a question
$q->qzml(); // display as example
?>