Flash gurus, please help!

luv2liv

Diamond Member
Dec 27, 2001
3,493
92
91
How would you put this php script into a flash swf file?
Basically, the script logs onto the server and pulls the schedule and outputs it into a table. The result can be seen here

I know Flash cant just display a php file. Have been searching on google but maybe I haven?t search with the right keyword. Any advice?

The php code is:
===========

<?
$connection = mysql_connect("localhost","x","x");

if (!$connection)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}

$db = mysql_select_db("verge", $connection);

$today = date(D);

$sql = mysql_query("SELECT * FROM `daily` where day='".$today."' ORDER BY 'mil_time' ASC");

$num_results = mysql_num_rows($sql);

if ($num_results<>0)
{
echo "<table align=center width=223 cellpadding=0 cellspacing=5 border=0 class=todaycontent>";

while ($row = mysql_fetch_array($sql)) {
$field1 = $row["time"];
$field2 = $row["classes"];
$field3 = $row["teacher"];
echo "<tr><td width=55>$field1<td>$field2<td>$field3</td></tr>";
}

echo "</table>"; }
?>
 

luv2liv

Diamond Member
Dec 27, 2001
3,493
92
91
Originally posted by: RESmonkey
*looks at code*

*dies*

yeah. i hate coding!!! im only a designer. lol
last time i did the site, i had a friend who did that "simple" code. all i did was draw.
 

rh71

No Lifer
Aug 28, 2001
52,853
1,048
126
Flash can read & display variables easily. I haven't kept up with the latest Flash versions but you basically set some "dynamic text" boxes [with equally set var names] (for displaying of those values) and use the actionscript function loadvariables() (against your .php file) in the flash file at any keyframe before it finishes loading. There may be a better way these days but that should give you a good start.

EDIT>> ie. loadVariables("data.php", _root);