Category Archives: MySQL

Join a sub query with group by statement

Find members that have the same password

More Advanced – Get minimum member ID from members that have same password:

 

Reference:

Get nearby places using SQL

Get result of stored procedure via PHP

DB account must have “execute” permission!

Stored procedure example:

PHP example: (Codeigniter)

Reference:

Using binary column in where clause

 

Update Column Values from Another Table

Reference:

Strict Mode

Windows installation of MySQL is strict mode. This setting will cause error when insert an empty string ” into a integer or date column even NULL is allowed.

To solve this, you need to disable strict mode using MySQL Command Line tool:

mysql_strict_mode

 

Reference:

  1. http://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sql-mode-setting
  2. http://blog.webhostingdiscussion.net/mysql/disable-mysql-strict-mode.htm