This is an internal tool I developed for a company in C#. The tool reads an SQL database (MSSQL, MySQL, over remote connection or from a file), and generates all the necessary files for the classes and the data access layer in PHP.
Sample files generated: http://steve.coolestech.com/files/sampleDAL.zip
Note: these files are just to showcase the generator and do not reflect the PHP code quality nor best practices (such as using parametrized queries).