Jump to content

PHP and Flash


johntp

Recommended Posts

Hey guys,

 

          You might be the wrong people to ask, but here goes.

 

I have a flash document that i use a guest book with. I use php for flash to talk to mysql, and am currently in a bind. I am trying to figure out how to make flash take an HTML table from php i have tried but I'm not sure if it's possible for flash to recognize HTML tables. I guess my question is can you import a table structured sql query from php into flash?

 

Here is my PHP Code for calling and printing the stuff i need

 

      
<?php
case 'read' :
	 // Fetch all comments from database table
	 $sql = 'SELECT * FROM `' . $table . '`';
	 $allComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
	 $numallComments = mysql_num_rows($allComments);
	 // Fetch page-wise comments from database table
	 $sql .= ' ORDER BY `id` DESC LIMIT ' . $_GET['NumLow'] . ', ' . $numComments;
	 $fewComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
	 $numfewComments = mysql_num_rows($fewComments);
	 // Generate Output for Flash to Read
	 print '&totalEntries=' . $numallComments . '&';
	 print "<br>&entries=";	

	 if($numallComments == 0) {
	    print "No entries in the guestbook, as yet..";
	 } else { 
	    while ($array = mysql_fetch_array($fewComments)) {
		   $name = mysql_result($fewComments, $i, 'name');
		   $email = mysql_result($fewComments, $i, 'email');
		   $comments = mysql_result($fewComments, $i, 'comments');
		   $time = mysql_result($fewComments, $i, 'time');
		   $state = mysql_result($fewComments, $i, 'state');
		   
		   print "
<table width='293' border='0' cellpadding='0' cellspacing='0'>
  <tr>
    <td width='100'>$name</td>
    <td width='193'>$email</td>
  </tr>
  <tr>
    <td>$state</td>
    <td>$time</td>
  </tr>
  <tr>
    <td colspan='2'>$comments</td>
  </tr>
</table>";
		   $i++;
	    }
	}
	// Print this only when there aren't any more entries..
	if($_GET['NumLow'] > $numallComments) {
	   print 'No More Entries!&';
	}
	break;
?>

Link to comment
Share on other sites

I'm not sure if this will be any help to you, but i do believe that you can include php files into a flash file however i cannot remember how to do this. A quick search on google will reveal to you how you can include a php file in flash.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.