# Displaying the news: PHP, Flash and MySQL

**URL:** <https://forum.kirupa.com/t/displaying-the-news-php-flash-and-mysql/177584>\
**Category:** flash\
**Created:** [February 3, 2006, 3:09am UTC](https://forum.kirupa.com/t/displaying-the-news-php-flash-and-mysql/177584 "2006-02-03T03:09:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mseerob](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mseerob](https://forum.kirupa.com/u/mseerob)\
**Post date:** [February 3, 2006, 3:09am UTC](https://forum.kirupa.com/t/displaying-the-news-php-flash-and-mysql/177584/1 "2006-02-03T03:09:02Z")

</div>

Hey there users. I’ll explain what Im trying to acheieve here.

In my MySQL database, I have some news in the database and I wanted to display them in flash. In my PHP page its going to loop so it will do this for example

March 24, 2004  
I did this and I did that

January 25, 2003  
I did this and I did whatever

July 2002  
What is the matter man!

So what Im trying to do is display those news in my flash but Im having some problems… Here is my line of code

Test.php:

\<?php require\_once(‘Connections/test.php’); ?\>  
\<?php  
mysql\_select\_db($database\_test, $test);  
$query\_test = “SELECT \* FROM test”;  
$test = mysql\_query($query\_test, $test) or die(mysql\_error());  
$row\_test = mysql\_fetch\_assoc($test);  
$totalRows\_test = mysql\_num\_rows($test);  
?\>  
\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)”\>  
\<html xmlns=“[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)”\>  
\<head\>  
\<title\>Untitled Document\</title\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” /\>  
\</head\>

\<body\>  
\<?php do { ?\>  
\<?php echo “&message=$row\_test[subject]”; ?\>  
\<?php } while ($row\_test = mysql\_fetch\_assoc($test)); ?\>  
\</body\>  
\</html\>  
\<?php  
mysql\_free\_result($test);  
?\>

But I do know how to display just one line of text in flash by doing this

news.php:  
\<?  
echo “&message= This is just a news flash. I need some help with your suggestions sir. Please call me back”;  
?\>

News.swf: actionscript  
Already made a dynamic text area and gave the instance name “message” and converted it into movie clip.

onClipEvent (load) {  
//assuming you have a personal web server and PHP installed locally  
loadVariables(“[http://localhost/PHP\_MySQL\_Flash\_Test/news.php](http://localhost/PHP_MySQL_Flash_Test/news.php)”, this, “GET”);  
}

And it will then display this in the flash: This is just a news flash. I need some help with your suggestions sir. Please call me back

But Im having problems when I try to loop the information. Please reply back
