Posts

MySQL Icon

MySQL Sum If Example

Here is a really good tip for using MySQL SUM IF functions if you need to do a bunch of different counts or sums on the same data set based off some conditional statements.

Read more

PHP Code

PHP Password Hashing and Password Security

There is a great article over at nettuts in regards to password security, properly hashing and storing passwords. It covers most of the basics including:

  • What is hashing
  • Storing hashed passwords
  • Hash collision
  • Rainbow Tables
  • Hash algorithm speed
  • Salting / Nonces
  • Which hashing function to use

For any developer creating applications or systems with user login, this is a must read. There is also a hashing class provided to use with your own code. Check out the article:

Understanding Hash Functions and Keeping Passwords Safe

If you have any questions about any of the topics, drop me a comment.

MySQL Icon

PHP Upload a CSV File into MySQL

Sometimes clients want to put all their products online in a database but don’t want to manage them as they may already be doing so in some kind of spreadsheet or offline database (Excel, Numbers, Filemaker, etc). For them, they don’t want to learn any new systems but want to have both areas, offline and online, up to date and mirroring each other. If you run into something like this, it’s very easy to populate your table via a CSV file upload.

Read more

MySQL Icon

MySQL: Identifying Slow SQL Queries

If you have a database driven site, like this one, the database will slowly increase in size and the tables will get bigger as your site content and traffic increases. Over time some areas that were fast to load in the browser start to slow down. Why is that? Well one possibility is that the database queries that generate the content on your page are not optimized. As your database keeps growing, these queries get slower and slower until the load time of a page is actually noticeable to one of your visitors. The first step is identifying slow queries.

Read more