Hey, I'm trying to load two fields from a MySQL table into one dynamic text field in Flash. This is done through a PHP file that calls the data from MySQL. Below is my PHP code. What actionscript code do I need in flash to load in the two fields?!
Or what PHP code do i need to change?! Somebody please help, thanks.
<?PHP
//Connects to the database
$link = connNBT();
//Get the stories from the mysql database
$query = "SELECT story, UNIX_TIMESTAMP(date) FROM newsTable ORDER BY date ASC ";
$result = mysql_query ($query)
or die ("Query failed - $query");
$i = 0;
$returnData = "";
while( $myrow = mysql_fetch_row($result) ) {
$story = $myrow[0];
$date = date("F j, Y", $myrow[1]);
$returnData .= "&story" . $i . "=" . $story . "&date" . $i . "=" . $date . "&";
$i++;
}
mysql_close ($link);
$data = "num=$i&" . $returnData;
echo "&data=" . $data;
//Function to connect to database
function connNBT() {
$link = mysql_connect ("localhost", "username", "password")
or die ("Could not connect");
mysql_select_db ("databasename")
or die ("Could not select database");
return $link;
}
?>