Flex does not include anything to handle connecting to the database, although using the AIR extensions for desktop apps has additional support when using a local embedded SQLite database.
So that means you need to use Flex HTTPService, WebService, or RemoteObject components to connect to your data.
From your post, I gather you may be most confortable with HTTPService and PHP, so here arer some links that show clearly how to use Flex, PHP, and JSON to transfer data to and from a MySQL database.
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
Flex Training and Support Services
As a continuation of Greg's answer, you may also use a Flex XMLService as long as you have an XML file that contains the data from the MySQL database.
can't i just generate a sample from using php,does that count as connecting to the database?
cos i delete a entry in the datagrid does not delete a entry in the database.
The problem is mentioned in this thread;http://forums.adobe.com/thread/713094?tstart=0