Northchild
09-09-2004, 02:04 AM
This is my first time integrating PHP with Flash, and I'm a bit unsure of myself. I'm using MX2004 and have PHP with MySQL support on a remote server. Overall, I'm trying to get a simple "random quote of the day" thing working.
Database has a table called allQuotes with one field named quotes.
Flash file has a dyamic text field named txtQuote on the main timeline, plus this code:
loadVariables("quotes.php", POST);
quotes.php has this code:
<?php
$link = mysql_connect(dbname, username, password) or die("Failed to connect to database.");
$query = "SELECT quotes FROM allQuotes ORDER BY RAND()";
$result = mysql_query($query) or die("Failed to execute query.");
$myQuote = mysql_fetch_array($result, MYSQL_ASSOC);
print "txtQuote=" . $myQuote[quotes];
?>
So far, I'm not able to get this to work... which is not surprising. Any advice greatly appreciated :)
Database has a table called allQuotes with one field named quotes.
Flash file has a dyamic text field named txtQuote on the main timeline, plus this code:
loadVariables("quotes.php", POST);
quotes.php has this code:
<?php
$link = mysql_connect(dbname, username, password) or die("Failed to connect to database.");
$query = "SELECT quotes FROM allQuotes ORDER BY RAND()";
$result = mysql_query($query) or die("Failed to execute query.");
$myQuote = mysql_fetch_array($result, MYSQL_ASSOC);
print "txtQuote=" . $myQuote[quotes];
?>
So far, I'm not able to get this to work... which is not surprising. Any advice greatly appreciated :)