SQL Code

Avoiding Errors When Restoring a MySQL DataBase

If you're ever trying to restore a MySQL database from a backup file, you may receive the following error: 051005 14:27:04 Error in foreign key constraint creation for table `table_name`. This is most likely to the fact that you are using InnoDB table formats, and you have foreign key contraints set up. Here's how to get past it.
SQL Code, Web

Find All Zip or Postal Codes Within a Certain Distance

This stored procedure will allow you to incorporate proximity searches into your web application. This is the perfect solution to retrieve businesses or otherwise within a certain distance of a specific zip/postal code, and calculate the distance in miles as well. This code takes into account the curvature of the earth in performing the distance calculation. It is assumed that you're storing the geocode for...