Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

geekindisguise

macrumors 6502
Original poster
Jul 22, 2008
297
0
Oklahoma
How do I go about connecting a Database to my Adobe AIR application?
The Database is on my webserver now. And I can connect to it from the regular web page, but I don't know how to connect to the same database from the AIR application.
Is Adobe AIR even able to work with PHP?

Thanks. :)
 
Of course you can use databases with AIR apps!
I know this because I use an AIR app called Lita to examine SQLite databases.

I've never tried to integrate databases into my work, but after a little research, it looks like only SQLite is useable, I'm not sure about MySql which is what I assume you have, you'll have to look a little deeper about that.

One tutorial I found

http://www.peterelst.com/blog/2008/04/07/introduction-to-sqlite-in-adobe-air/

If that doesn't work out, I know Actionscript can work with PHP
One tutorial is here
http://gotoandlearn.com/play?id=90
 
Is this all with External Databases? Because I know how to make the database for that application locally.

But I want to connect to a Database that is updated a lot on my web server.
 
? If you already know how to connect to a database locally, then why did you ask your question in the first place?

You'd connect in the exactly the same way you connect to your local database, except, instead of having it connect to something like "localhost" you'd set that parameter to connect to '55.33.10" or whatever address your webserver is. You'd have to include the parameters like username or password too if those are set for that particular database.

As to working with PHP,
I had assumed you understood that Actionscript is often times, an essential component in making AIR apps, which is why I pointed out the tutorial on using PHP with actionscript. Do you not have any actionscript in your AIR app?

It'd be helpful for you to explain how you're connecting locally, what technology you're using(MySql,SQlite), etc.
 
Its really that simple? I thought you had to do more than that. Can I put my domain instead of the IP? Because I have a dynamic IP, and my domain gets updated automatically.

I am using Mysql.
 
Well, yes, it really is that simple.

You could try using your domain but since thats simply masking an IP anyways, it may or may not work.

If you're using MySql, you'll have to do a little more research, as I have no clue if MySql will work with Air apps, all the things I came across referred to SQLite.

maybe someone else will come along that knows the answer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.