|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
loading [mySQL] text data into Flash
Hi all,
Was wondering if anyone could help. I am trying to load text data from a mySQL database into flash mx. I have a textboxwith an instance name of 'Results' that receives the info from php. Does anyone know the best way to code the php? code: <?php $db = mysql_connect("localhost", "benbaker",'********'); mysql_select_db("benbaker",$db); $result = mysql_query("SELECT * FROM pets",$db); ?> At the moment this comes up in Flash with all of the variables and with %20 where there should be spaces... My flash file contains one frame with with this code on it: myLoad = new LoadVars(); myLoad.onLoad = function(done){ if (done){ Result.text = myLoad } else { trace("something went wrong"); } } myLoad.load(".../PHP/dogs.php"); |
|
#2
|
|||
|
|||
|
I eventually want to have a set of 4 text boxes called:
Name: Age: Height: Weight: And each of these information areas are loaded from the mySQL. |
|
#3
|
|||
|
|||
|
i do beleive it goes a little something like this:
php file: dogs.php <?php $query = "SELECT * from bla WHERE bla;"; $request = mysql_query($query); for($k = 0; $k < mysql_num_rows($request); $k++) { $row = mysql_fetch_row($request); print "&row_".$k."=".$row[$k]; // echo sring to url } ?> myLoad = new LoadVars(); myLoad.onLoad = function(done){ for(var i in this) { result.text += "\n"+i+" = "+this[i]; // should show you all that's returned. you will have to parse out the 'onLoad=type function' bit. } myLoad.load("../PHP/dogs.php"); // note 2 dots, not 3 any good to you? let us know how you go! e Last edited by 1ain : July 29th, 2003 at 12:23 PM. |
|
#4
|
||||
|
||||
|
but change the following:
$query = "SELECT * from bla WHERE bla;"; to: $query = "SELECT * from bla WHERE bla"; christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > loading [mySQL] text data into Flash |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|