Best practice is so write a web-service in PHP/MySQL and then call the information into the widget via WML/JSON. There would be quite a lot to explain here.
Steps and Process.
1. Call URL() from the widget
2. Parse the returned data
3. Use a Grid or other objects to display the information
We provide some very clean and well documented examples in our Developer Toolkit. You can sign up for free and access all our tools and examples:
http://www.widgetrealm.com/developers