[php] send simple data from php to flash

hello
this is probably the simplest question about working with php and flash but i’m sick of search and i can’t find the answer or a tutorial that do exactly what i want :frowning:

i have this php script to get data from my mysql database and i want this data to appear on a flash textfield. i want ALL the data. not only the data from the first row.

the script i’m using is:

<?php
mysql_connect(“localhost”,“","”);
mysql_select_db(“flash_news”);
$qr = mysql_query(“SELECT * FROM flash_news”);
$nrows = mysql_num_rows($qr);
for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($qr);
echo $row[‘author’].", “.$row[‘title’].”<br>";
echo " “.$row[‘body’].” “.$row[‘timestamp’].”<br><br>";
}
?>

now anyone can please(!!) tell me how to put this in a flash txt field?
Thanks alot and sorry for ask something to basic but i can’t find any tutorial with this. all tutorials that i find is for more complex things and i just need this for now :]

Thanks for your help.

I’ll probably only need to add code to the text field but if’s it’s more than this please explain step by step :sigh:


  <?php
  mysql_connect("localhost","****","****");
  mysql_select_db("flash_news");
  $qr = mysql_query("SELECT * FROM flash_news");
  while($row = mysql_fetch_assoc($qr)) {
   echo $row['author'].", ".$row['title']."<br>";
  echo " ".$row['body']." ".$row['timestamp']."<br><br>";
  }
  

While
Assoc

this is your help? :frowning:

er… but and what i have to do in flash for this script work?

I dunno if this helps or works, its bits of something I am working on and I dont know crap about PHP/mySQL.


   $DBhost = "*****";   
   $DBuser = "*****";			
   $DBpass = "*****";		   
   $DBName = "*****";			
   $table = "*****";			 
	 
   $DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error" . mysql_error());
	  mysql_select_db($DBName, $DBConn) or die("Error" . mysql_error());

   $action = $_GET['action'];
   
   switch($action) {
	  case 'read' :
	  $sql = 'SELECT * FROM `' . $table . '`';  
	  $allComments = mysql_query($sql, $DBConn) or die("Error" . mysql_error());
	  $numallComments = mysql_num_rows($allComments);

   print "<br>&info="; 
	 if($numallComments == 0) {
	  print "	   No data.."; } 
   else { while ($array = mysql_fetch_array($fewComments)) {
		 $data = mysql_result($fewComments, $i, 'data');
		 
	print 
	 '
	Data: </b><br>' . $data . '</i><br>
	';
		   $i++;
	  }}
 

In flash


function loadEntries(act, increment) {
 
myEntries = new LoadVars()  myEntries.ref = this
 myEntries.load("myphpfile.php?action=read&r="+random(999)+"&NumLow="+_parent.NumLow) 
 myEntries.onLoad = function(success){ 
  if(success){ 
   
   
mytextbox.text = this.info;
}