Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 01:42
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Recent Tutorial Support
| |-+  Flash GuestBook Support (Moderators: Flash-db, vesa kortelainen, Ronald Wernecke, Mohsin Sumar, Jorge Solis)
| | |-+  How on earth does this happen?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: How on earth does this happen?  (Read 2540 times)
XCache
Server what's that
*
Posts: 2



View Profile
« on: 01/25/02, 20:32 »

I have a mysql database with all the info in it and I want to print it to a flash text box. I thought I could find out how yours works but I just can't see how it does. When you run the PHP is shows &TotalEntries=0&NumLow=&NumHigh=&GuestBook=

I have looked all over and I found that the Text Box name is GuestBook. How does the text get in the text box? I don't see GuestBook= anything. Its wierd. If yas could point out what line or lines prints the info to the text box then that would help lots.

Thanx

XCache
Logged
Flash-db
Administrator
Systems Administrator
*****
Posts: 1867



View Profile WWW
« Reply #1 on: 01/26/02, 20:46 »

Hey XCache,

Yes that part might be a little confusing to see at first.  I'll go over it line by line.  Take a look at the following code:

//Opens up the file declared above for reading
//This opens up the Text file.  The text file is just a large set of arrarys seperated by the .:::. pattern.

   $fp = fopen( $filename,"r");
   $Data = fread($fp, 80000);
   fclose( $fp );

#Splits the Old data into an array anytime it finds the pattern .:::.

   $DataArray = split (".:::.", $Data);

#Counts the Number of entries in the GuestBook

   $NumEntries = count($DataArray) - 1;

// This is the line that I'm assuming your having trouble with.  This first prints out a couple of items such as Total Entries, And what set in the GuestBook we are currently looking at (the high and low numbers 1-10 for example).  
//You'll notice that after this we have the "GuestBook=" part.  After that is printed out we print out the Set of Arrays that we will be using for the given High and Low Numbers.  (That's $n = $NumLow; $n < $NumHigh; - If we where to put numbers in that would be - $n = 1; $n < 10;  If we wanted to look at the guest book entries numbered 1-10. )

   print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
   for ($n = $NumLow; $n < $NumHigh; $n++) {
   print $DataArray[$n];
      if (!$DataArray[$n]) {
      Print "<br><br><b>No More entries</b>";
      exit;
      }
   }

The GuestBook= part does not exist until the script is run and places the GuestBook= part in front of the Data that Flash will be reading in.  That is then read into Flash.  This makes things a little bit faster because it would take a long time to read in all 600-700 hundred entries or however many your guestbook has.  Instead it's only really reading in 10 at a time.  It does still take more time to load when the guestbook entires get up really high, just because it's a large text file.

Ok - hope that didn't confuse you anymore.  But that should answer your question, if not let me know.


Logged

-Jeff.
XCache
Server what's that
*
Posts: 2



View Profile
OIC
« Reply #2 on: 01/26/02, 21:24 »

Ahhhhhhhhhh. So the guestbook= part at thge end of the line just makes the text box = whatever the php is reading in, from numlow - numhigh of course...
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!