473,413 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Loading variables from external PHP script

35
Hello there,

I'm using Flash to present data which I am pulling out of a MySQL database using a PHP script.

The setup is like this; in the frame in which I want to present the data I have a loadVariables line which loads the data into a dynamic text field variable. The PHP script opens up a database connection, runs a couple of queries, then closes the connection.

The problem is, that it doesn't work very consistently. When I jump back to the previous frame in the Flash movie and then back, only sometimes does it "reload" the variables. It could have something to do with the SQL connection but I'm not sure.

Anyone knows what might be an issue here?

Thanks in advance...
Oct 3 '07 #1
2 2292
Hello there,

I'm using Flash to present data which I am pulling out of a MySQL database using a PHP script.

The setup is like this; in the frame in which I want to present the data I have a
loadVariables line which loads the data into a dynamic text field variable. The PHP script opens up a database connection, runs a couple of queries, then closes the connection.


The problem is, that it doesn't work very consistently. When I jump back to the previous frame in the Flash movie and then back, only sometimes does it "reload" the variables. It could have something to do with the SQL connection but I'm not sure.

Anyone knows what might be an issue here?

Thanks in advance...

If your php script places all the mysql data in one variable and then printed,
example:
while ($sqlData = mysql_fetch_array($sqlDatabase))
{
$my_sqlData .= sqlData['entry']; //keeps adding data to one
variable
}

print "flashTextField=$my_sqlData";// prints the entire data

this might take a very long time and might pose problems. A better practice would be to print the data right away.
example:

print "flashTextField="; //enters blank text just to declare where to print the
data
while ($sqlData = mysql_fetch_array($sqlDatabase))
{
$my_sqlData = sqlData['entry'];
print "$my_sqlData";// prints data one at a time. It won't overwrite previous
data.
}


if thats not the prob, then something in flash might be preventing the php script from running properly..maybe flash functions not executing at the right time or something. Or possibly, flash variables are not being reloaded or something..i'm a newbie too..lol
Oct 14 '07 #2
Hi Brixton,

Just my guess, this could be due to caching in the browser.
Did you try disabling the caching in the PHP?

<?php header("Cache-Control: no-cache, must-revalidate");

Hope this helps...
Oct 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mr_burns | last post by:
Hi, i was wondering if it is possible to load text into a string from an external text file. the reason is that i have a very large string and it is making my script very messy. also, is it...
5
by: danny.myint | last post by:
I was under the assumption that javascript loads all the <head></head> elements before processing the <body> tag in Mozilla/Netscape/Firefox. It doesn't seem like it, with my problem. I have...
5
by: joaopedrogoncalves | last post by:
Hi, I want to load an external javascript file, get its results and stick them inside a <div> block. I also want to do this in several places on a web page. This way the browser doesn't have...
2
by: Deb M. | last post by:
I am trying to find out how I can use the ASP.net framework yet still post the variables to an external script (not ASPX) after the form has been submitted. So, the ASPX page will still post to...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
1
by: ozzy.osborn | last post by:
Hello All, I have been struggling with a cross browser solution to loading external javascript files on the fly. I have been successful using the following code in IE6: var newScr =...
6
by: Venkatesh | last post by:
Hello All, I have couple of doubts regarding the concept of on-demand javascript loading using javascript code. I could see on the net different techniques for achieving this - techniques like:...
0
by: wez03 | last post by:
Hi everyone.. I got a problem in loading an external txt into my dynamic text. It says that there are no error in my script but when I publish it, the only thing seen in the text field is...
6
by: aaronkmar | last post by:
Trying to get a loading image to spin while the query is loading. I can get the data div to fade in, but I can't seem to figure out how to get the gif while the query is loading. I'm using two...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.