flash db ?
- Started
- Last post
- 7 Responses
- heavyarms
I'm getting data from a DB and bringing it into Flash via load variables and a CFM page. At the moment I can only bring in one record at a time.
The output looks like this at the moment:
''
&info=
''
''
#dateFormat(blog.date_entered, 'mmm dd yyyy')#
#blog.name#
#blog.subject#
#blog.message#
''I have the info variable in a separate output at the moment so it won't loop. Obviously when it was in the same output the info variable was just overwriting itself.
NT won't let me post tags so pretend the top quotes are a cfoutput and the bottom ones are a cfoutput with a query name so it will loop.
Anyone have a tip?
- unfittoprint0
I would help, but i only work with php/MySQL.
_____________ anyway....
within the loop you shouldn't have a = but the a .= [or a CMF similar]. It will add instead of reseting the variable....
- heavyarms0
So variable period equal sign? I think it's the same idea with CF/PHP. I'm sure you get what I mean with cfoutput outputs a variable but if it has query equals on it it will loop through a query. I can't believe my example didn't work. It seems obvious that it would write the info variable once and then loop through the query for the data for the info variable.
- heavyarms0
What does the period generally do in PHP?
- unfittoprint0
$myVar = "this";
$myVar .= " and that";
print $myVar;
//this will print "this and that"
to send variables to FLash I must send them as an unique string with & separating each variable's value.
My prefered method nowadays is to create n XML output of the db query. That makes the parsing within Flash much easier and intuitive in my opinion.
- heavyarms0
Thanks for the info. I was trying to loop my results in one textfield with the variable name info. I've seen examples that duplicate the movie clip for each record but that looks like a pain in the ass.
- MACAS00
It's good when you try to copy code, but I guess it can't be done with Flash, right? Go read a book.
- heavyarms0
What are you talking about dude? Was that an insult? I'm not copying anything. Just trying something new.