Mike Potter

October 04, 2006

Using Flex to browse a MySQL database using PHP - Updated PHP SDK

I have created a sample Flex application that lets you browse your MySQL databases and allows you to do simple filtering on that data. The application is part of the PHP RIA SDK by Adobe that I've updated today. It also includes some new samples and libraries, mostly done by community members. Pete Mackie contributed a sample using the WebORB for PHP library which is in the samples/flex/simple_weborb_php directory. The Weborb for PHP library is now also included in the SDK, under the libraries/weborb directory.

The Flex MySQL browser is not meant to be a replacement for PHPMyAdmin, but I find it faster for browsing data. PHPMyAdmin does much more than this simple application, but if you're looking for a piece of information in a database, you may find it faster to use tthis Flex application.

If you would like to extend the Flex MySQL browser, you can join the Google Code group for the PHP RIA SDK by Adobe and / or the Flex / PHP mailing list at Google Groups.

I'll be showing off this and more at the Zend / PHP Conference later this month in October.

Please post issues with the SDK in this blog.

Posted by Mike Potter at 03:29 PM on October 04, 2006

Comments

Mark Piller — 04:14 PM on October 04, 2006

Mike,

Thanks for the update, the browser looks cool. I'm glad to see you're using WebORB's GenericDestination in the browser's remoteObject. I'm thinking of porting the backend for that example to RoR and .NET to showcase it for those environments.

Cheers,
Mark

John Hattan — 05:14 PM on October 04, 2006

Don't know if you've seen it, but tufat.com has a full replacement/reskin of phpmyadmin done in Flash.

It's not free, but it's about the best five bucks I've ever spent.

Mason Brown — 09:51 PM on October 04, 2006

Awesome! So far these updates look pretty helpful. However, I do have a few questions:

1) Is WebORB required for the mysql_flex application to work?

2) Do we need PHP5 or the Zend Platform with PHP5 support in order for the mysql_flex application to work?

3) Also, in the mysql_flex.mxml what should the RemoteObject.destination and RemoteObject.source values reflect?

Thank you and keep up the good work!

[Mike's responses:
1. Yes, WebORB is required for mysql_flex to work.
2. You need PHP 5 in order for mysql_flex to work (and WebORB in general).
3. You shouldn't need to change those values at all. The destination should be setup as a GenericDestination, with the source reflecting the filename of what's being called (in this case MySQL). Note that the classname needs to match the file name (so in MySQL.php you have a class named MySQL).
Does that help?

Mike]

Quantum — 11:43 AM on October 10, 2006

Hi !
I can't run the mysql_flex sample ???
I got an error saying that I don't set the server, username and password but I did !
And when I try to run the MySQL.php file I get a Warning: Missing argument 1 for MySQL::getDatabases() in...
Please could yoou help ?
Q.

Chris — 03:22 AM on October 11, 2006

Nice but allot of the samples give errors... :( The mysql thingy works ok though
[Mike - What errors are you receiving?]

Pedro — 05:53 PM on October 16, 2006

Mike,

Sorry by bother you and take from your time.I'm trying to run the example(the MySqlexample to see the tables, like the PHPMyADMIN) and I can see in Mozilla(at the bottom of the browser) that start to connecting with the localhost but I did not receive any data back. I know my Server its working because I can see it using PHPMyADMIN.Also I tried other samples and I think I'm doing something wrong or I'm assuming something.I will appreciate any help. Thanks.

robert — 08:25 PM on October 16, 2006

I keep getting this error when i try to run the simple_amfphp program.

SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///C:/Documents and Settings/Robert/Desktop/simple_amfphp/bin/simple_amfphp.swf cannot access file:///C:/Documents and Settings/Robert/Desktop/simple_amfphp/bin/simple_amfphp.html.
at flash.external::ExternalInterface$/flash.external:ExternalInterface::_initJS()
at flash.external::ExternalInterface$/call()
at simple_amfphp/onInit()
at simple_amfphp/___Application1_creationComplete()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

Xavier Dumas — 11:37 AM on October 22, 2006

We have a problem with your script i think, it only works with IE, but not with Mozilla Firefox.

Do you know why ?

Regards.

--
Xavier Dumas

Thank you for signing in, You may now comment. (Sign Out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Add your comments

Remember Me?

(You may use HTML tags for style.)