Current location: Hot Scripts Forums » Programming Languages » PHP » Flash Database


Flash Database

Reply
  #1 (permalink)  
Old 03-25-06, 02:44 PM
SkullShady SkullShady is offline
New Member
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Flash Database

Hey ppl, i don't know if this is the right place to post but i don't see a Flash or Actionscript section but since it has to do with databases here goes:
Is it possible to like, use a MySQL database so a person can log in as an admin and post news in a flash site, so i wouldn't have to edit the flash thing when i want to post news? Also, I was wondering if its possible to edit the news in a regular php page and it would appear in the flash site? Either is fine if anyone can help me. Thank you. (BTW great job with this site, i've found it really useful)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-25-06, 07:54 PM
jnl2009 jnl2009 is offline
New Member
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
What you want to do is pretty easy, here is how I do it:

In your flash file you enter the following:

var c = new LoadVars();
c.sendAndLoad("FileName.php",c,"POST");
c.onLoad = aFunction;
function aFunction(){
see below;
}

In your php file use this:

$hostname = " ";
$database = " ";
$username = " ";
$password = " ";
$sqlCon = mysql_pconnect($hostname, $username, $password)
mysql_select_db($database, $sqlCon);
$query_rsList = "SELECT ....";
$rsList = mysql_query($query_rsList, $sqlCon) or die(mysql_error());
$row_rsList = mysql_fetch_assoc($rsList);
$totalRows_rsList = mysql_num_rows($rsList);
print "&flashVariable=";
do {
print $row_rsList['mySQLField1'].",";
print $row_rsList['mySQLField2'].",";
print $row_rsList['mySQLField3']."|";
} while ($row_rsList = mysql_fetch_assoc($rsList));
mysql_free_result($rsList);

The flash file will load a variable that looks like this:

flashVariable=mySQLField1,mySQLField2,mySQLField3|

So the flash function above just needs to split the string into an array like:

records = c.flashVariable.split("|");

Then do whatever you need to with the records array. Hope this helps (and I hope it works)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CamDate - Adult, Dating & Community Orientated Flash Audio / Video Chat Software CamDate.Biz General Advertisements 1 09-17-07 10:21 AM
loading sound from database in Flash toth ASP 0 10-24-05 10:39 AM
Simple, searchable book database max fischer Script Requests 0 05-14-05 02:00 PM
Php with flash or without tables ? EraseR PHP 0 06-26-04 08:36 AM


All times are GMT -5. The time now is 12:04 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.