Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-07-2009, 03:47 PM   #1
McFreaq
Registered User
 
Join Date: Mar 2008
Posts: 20
Smile best way to access local mysql database from AS3?

Hi Guys,

I'm currently working on a flash project which will later run locally and offline on a PC. On this PC, there will also be a MySQL database which I need to access.

Now I'm looking for a proper way to do this. I have good skills in AS3, and have used PHP and MySQL alone in several web projects. But so far I have never used MySQL together with Flash.


So in which direction should I start looking for a good solution? What would be a good way to access a local MySQL database from a locally running SWF?

Any ideas highly appreciated!
McFreaq is offline   Reply With Quote
Old 01-07-2009, 03:54 PM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy and Welcome...

You still need a middle man to talk to the database... That means that you'd need to make a local server that hosts database and the PHP that your SWF can call to get the data...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 01-07-2009, 04:04 PM   #3
McFreaq
Registered User
 
Join Date: Mar 2008
Posts: 20
Default

Hi CyanBlue, thx for your reply!

On the PC I mentioned, there will be XAMPP running as my local »webserver«, did you mean that? So I can run PHP files if that's necessary to access the database.

What I'm missing right now is a way to call for example a PHP file with AS3 and give it a certain MySQL query. And a way to get my data back from the PHP file. How would I do that?
McFreaq is offline   Reply With Quote
Old 01-07-2009, 04:07 PM   #4
McFreaq
Registered User
 
Join Date: Mar 2008
Posts: 20
Default

I just found this one:
http://asql.mooska.pl/

It seems to be an AS3 library that enables direct access to a MySQL database without the need of PHP or a webserver, if I understand it right. I will check this one out and report back.

Has anyone used this so far?
McFreaq is offline   Reply With Quote
Old 01-07-2009, 04:07 PM   #5
ggalan
Senior Member
 
ggalan's Avatar
 
Join Date: Feb 2006
Location: New York
Posts: 620
Default

have you looked into amfphp?
http://www.amfphp.org/
gotoAndLearn has a tutorial
http://www.gotoandlearn.com/play?id=78

Last edited by ggalan; 01-07-2009 at 04:11 PM.
ggalan is offline   Reply With Quote
Old 01-07-2009, 04:22 PM   #6
Rossman
Senior Member
 
Rossman's Avatar
 
Join Date: Feb 2004
Location: Toronto, Ontario
Posts: 1,301
Send a message via ICQ to Rossman
Default

Use adobe air and the database within it, perhaps?
__________________
the beers just sit there, silently staring, and mocking the mistakes my animal mind makes sometimes - Spyre
Rossman is offline   Reply With Quote
Old 01-07-2009, 04:29 PM   #7
McFreaq
Registered User
 
Join Date: Mar 2008
Posts: 20
Default

THX gglan, I'm already watching the tutorial!

THX Rossman!
I have not worked with Adobe AIR so far. And I think I'm bound to using the MySQL database as there has already a browser-based interface been made to administrate the database…
McFreaq is offline   Reply With Quote
Old 01-07-2009, 04:35 PM   #8
Rossman
Senior Member
 
Rossman's Avatar
 
Join Date: Feb 2004
Location: Toronto, Ontario
Posts: 1,301
Send a message via ICQ to Rossman
Default

Fair enough. Air is just like Flash except there are a few more API's to let you do stuff like read and write files, store data in the built-in database, etc. Just thought I'd throw it out there in case it was a better solution for ya!
__________________
the beers just sit there, silently staring, and mocking the mistakes my animal mind makes sometimes - Spyre
Rossman is offline   Reply With Quote
Old 01-07-2009, 04:48 PM   #9
McFreaq
Registered User
 
Join Date: Mar 2008
Posts: 20
Default

Yeah, THX in any case, Rossman!

I didn't want to be rude, just wanted to define my working situation for the project.
So out of interest but off the records, what kind of database is available through AIR?
McFreaq is offline   Reply With Quote
Old 01-07-2009, 05:04 PM   #10
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

That'd be SQLite...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue 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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Not Connect to MySql DataBase JavaFaces Other Flash General Questions 3 10-27-2010 06:56 PM
can't upload file from flash and save to mysql database using php hungboy Server-Side Scripting 6 04-21-2008 10:31 PM
Flash 5, ASP & Access Database chuksted Server-Side Scripting 1 05-20-2002 03:41 PM
My first Access database JRBT Server-Side Scripting 1 03-28-2002 07:14 PM
Connection between Flash 5 and Access database Weebbo2000 Simple Stuff (Newbies) 2 11-16-2001 09:42 PM


All times are GMT. The time now is 03:40 AM.

///
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.