PDA

View Full Version : About mySQL


avelives
03-22-2003, 02:28 PM
I have been asked if its possible to set up an SQL database on a flash site, and i basically have no idea when it comes to databases etc so is this possible? i believe they want to display links and be updateable but surely i could replicate these functions with things like external text files in flash??
Can anyone shed any light on this for me??

butterbur
03-22-2003, 02:44 PM
Flash cannot communicate directly with a database, you will need to use a server side langage such as PHP/ASP to sit between the two. Databases such as mySQL offer a powerful method of data storage and retreval and IMHO is well worth the time to learn.
Remember if you get stuck then this forum has some bright people always willing to help.

Mortimer Jazz
03-22-2003, 02:53 PM
Possible and suprisingly easy (I've just statred to learn myself).

If the only updatable info on the site are a few links then a text file would be the quickest option, but if you have the opportuntiy to learn php/mySQL and are going to get paid to do it, well ......... :)

avelives
03-22-2003, 03:10 PM
Hmm so learning PHP or the like would seem the course of action then huh??
Any of you guys know a good place to to learn the basics of setting up databases with said languages??
How realistic of me would it be to learn PHP?ASP while building the site, is it a steep learning curve or is it simpler than it sounds?

butterbur
03-22-2003, 05:18 PM
The basics needed for the task you described should be fairly easy for you to pick up. Pay a visit to hotscripts (http://www.hotscripts.com/PHP/Tips_and_Tutorials/Database-Related/) where you will find many tutorials.

avelives
03-22-2003, 06:26 PM
thanks ill check that out

avelives
03-23-2003, 11:31 AM
Ok checked that out and although i may learn it soon im kinda in the middle of learning actionscript so im thinking ill do this site with external tet files instead.
Is it possible to add MySQL after a site is made or is this logistically impossible??

butterbur
03-23-2003, 12:10 PM
You can 'plug' data from mysql in later. It's usually a good idea to climb one mountain at a time:)

CyanBlue
03-23-2003, 12:10 PM
It is not impossible, but I think it will take big time to change it mainly because you have to develope PHP code to interact with MySQL database at the same time... ;)

avelives
03-23-2003, 12:16 PM
Indeed climbing one mountain at a time is the key i think, i would love to be able to implement database interactivity but my knowledge of them is pretty sucky at the mo, so will concentrate on actionscript for a while and learn that when i have a better grasp on it all.
I was unsure what to do, but luckily the site i might be doing only needs dynaimc links and content to be easily updatable so i think i can achieve this with external text files for the link sections.
Cheers guys

Emanweb
03-23-2003, 05:53 PM
If you have Flash MX w/ Coldfusion MX it is possible now to use Server Side Actionscript and then have flash talking straight to the database - it is not the cheapest solution but the easyest one.
(extracted from the Using Flash Remoting Help)
For example, the following server-side ActionScript function definition returns a RecordSet object:

function basicQuery()
{
mydata = CF.query({datasource:"customers",
sql:"SELECT * FROM myTable"});
return mydata;
}

You should take a look at flash remoting documentation, in order to accomplish the database connection. The PHP community is also working on a PHP version of flash remoting but I am not sure how mature this project is at this time.
One good start is reading this article from the Flash Help:
Connecting with External Sources > Sending and loading variables to and from a remote source > Using HTTP to connect to server-side scripts

HTH

Emanuel