PDA

View Full Version : formatting database output


aurir_
04-12-2006, 06:46 AM
How do you format data from a database. Suppose the query returned 100 different products and you would like to display let's say 20 results per page in Flash. Do you create a movie clip for everyone??? And how do you handle scrolling???

Cota
04-12-2006, 12:53 PM
That depends on what we're talking about...we talking about images? If so, there are a few ways to handle that. Either a scrollpane or like you said, results per page.

aurir_
04-14-2006, 07:14 AM
More specificaly, if a user looks for particular books written by XXX author, I want the querry to return all books written by that author. More specifically, titles, authors, edition, and thumbnail if available. I have no problem doing it in html using php the sends and resceives info from mysql database.

Cota
04-14-2006, 04:21 PM
Then you're half way there. Using PHP...make the same query, "echo" the results. In Flash use LoadVars(). Here is an example using ASP
http://www.actionscript.org/forums/showthread.php3?t=67379

aurir_
04-15-2006, 12:46 PM
Yes, I know how to use load vars. My question is what is the best way to format this info. Do you create a movie clip for each row in the database, or do you create a text field, or something else???

Cota
04-15-2006, 11:53 PM
Either or...it all depends on how you want it displayed. Simple display is to create textfields for it. You can put those textfields in a scrollpane if its a lot of data coming in.

Colin Campbell
04-16-2006, 01:58 AM
You'll probably want to attach a movieclip for each of the rows in the MySQL query returns. Text field would limit you in what you can do, but if you attach a movieclip that can honest multiple textfields and even other movieclips, you have much more room for expansion.


for (var i=0; i<this.numberOfProdsPerPage; i++) {
_root.site.productsHost.attachMovie ("productsMC", "product"+i, 50+i);
var products = _root.site.productsHost["product"+i];
products._y = 50*i; //where 50 = the height of each row for products
}