Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-10-2002, 01:03 PM   #1
DocFirestorm
Registered User
 
Join Date: Feb 2002
Posts: 4
Default mysql,php,flash

Hey!

I have a question about getting the results from a query into my flash movie.

the code:

$sql = "SELECT * FROM table LIMIT 0,3 ORDER BY TIMESTAMP";
$result = mysql_query($sql);
while($row = mysql_fetch_object($result)
{
print (&message=$row->......);
}

if i extract the script without flash i get 3 results.

in flash im made loadvar.... and insertet in a textbox if the variable is loaded.

when i put the & away from the php code i get 3 result but like this test1message=test2message=test3

i tried it to split i up but i didnt work fine

thx
DocFirestorm is offline   Reply With Quote
Old 02-11-2002, 05:35 AM   #2
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

I'm not exactly sure what the problem is but bear in mind that flash can only read in strings, not objects. I tend to use mysql_fetch_array and then send back each item in the array:
Code:
echo "&var1=$row['var1']&var2=$row['var2']";
I know it's prolly more typing but it works. Also it's wise to add something like "&EOF=true" at the end of the string so you can tell when loading is complete.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 02-11-2002, 06:19 AM   #3
DocFirestorm
Registered User
 
Join Date: Feb 2002
Posts: 4
Default fixed it

I allready fixed it. the problem was that my variable declaration was inside the while loop so made it like this

print("$message=")
while ($row=mysql_fetch_object....)
{
print("$row->......")
}
DocFirestorm is offline   Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL,PHP,Flash Login intake ActionScript 1.0 (and below) 1 11-28-2004 10:54 AM


All times are GMT. The time now is 09:19 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.