Click to See Complete Forum and Search --> : Okay now my data is stored in SQL how do I get it back into FLASH
graphics4you
07-30-2004, 05:52 PM
I am not that great at database stuff but I was able to make a form send the info to a php page and into an MySQL database. Now is there an easy way to import my data back in Flash and view it?
Its just like first name, last name, e-mail address stuff nothing complicated. Maybe Flash has a nice component that will make an easy to use note card system for each row of data. Or maybe flash has a dynamic table thingie for my data.
Any idea's on this?:confused:
Musicman
07-31-2004, 02:35 AM
Hi,
before you look into tables and stuff, try this
a movie with text fields (varname firstname, email, etc)
and a button that loads variables from a php script
the php script:
<?
include "dbstuff.php"; // same as your save script
$result = mysql_query("select firstname, lastname, email from cards limit 1");
$row = mysql_fetch_array($result);
print "&firstname={$row['firstname']}&lastname={$row['lastname']}&email={$row['email']}&";
?>
Musicman
graphics4you
08-02-2004, 10:56 AM
Thanks for the php code.
So we are limiting the results to one row of data at a time - right?
row = one row of data from first name on.
So now how can we
1. get a total number of rows. (how many people entered information)
2. have flash display the data. (again we need some sort of dynamic table or something)
3. It would be really nice to let people download an excel file of the data - like a report.
Any idea's?
Musicman
08-02-2004, 02:38 PM
Hi,
one row at a time means you dont have to worry about display - and can still play with features such as select on search criteria
There is no problem to loop over all rows, and also no big problem in creating a download file ... but you may have to teach visitors that a csv file also is excel
Musicman
CNL83
08-02-2004, 02:51 PM
What is the code in Flash for the text fields to pull from that php script?
Musicman
08-02-2004, 04:18 PM
Hi,
if you want to make life easy, just use loadvriables in the same timeline where you have the text fields, and give them variable names email etc.
loadVariables('script.php', _root);
Musicman
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.