I recently worked with another developer to convert a lot of MSSQL stored procedures into PHP/MySQL functions. Along the way I learned a bunch of new things which I figured would be helpful to you.
The MSSQL “ISNULL(expr1,expr2)” equivalent in MySQL is “IFNULL()”.
The MSSQL “TOP” keyword (to limit returns returned) equivalent in MySQL is “LIMIT”.
SQL query strings that are built with dynamic data (such as form data) are *always* susceptible to SQL injection attacks. Here’s a few discussions to keep you safe:
- Protecting MySQL from SQL Injection Attacks with PHP
- A great token building function similar to the common sprintf()
- The final code I used for my quote_smart() helper function
Here’s a couple more links which may be helpful but which I didn’t really get far into reading…
- PDO (PHP Data Objects) — A built in PHP 5.x extension Data-access Abstraction Layer
- Migrating from Microsoft SQL Server and Access to MySQL
If you need some coding help, or better yet you want to hire me for a coding project, leave a comment for me on this article and I’ll get in touch with you =)