Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 29th, 2003, 10:46 AM
nebrekab nebrekab is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 7 nebrekab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 45 sec
Reputation Power: 0
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");

Reply With Quote
  #2  
Old July 29th, 2003, 10:48 AM
nebrekab nebrekab is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 7 nebrekab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 45 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old July 29th, 2003, 12:21 PM
1ain 1ain is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Bath
Posts: 26 1ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old July 29th, 2003, 01:02 PM
christo's Avatar
christo christo is offline
Introspective
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Nov 2001
Location: London, UK
Posts: 3,296 christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 1 h 5 m 42 sec
Reputation Power: 101
Send a message via ICQ to christo Send a message via Yahoo to christo
but change the following:

$query = "SELECT * from bla WHERE bla;";

to:

$query = "SELECT * from bla WHERE bla";


christo

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > loading [mySQL] text data into Flash


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway