MySQL: mysqldump

The mysqldump client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL databases for backup or transfer to another SQL server. The mysqldump command can also generate output in CSV, other delimited text, or
Continue reading MySQL: mysqldump

MySQL: date interval

SELECT *, DATE_FORMAT(insertTimeStamp, ‘%d-%m-%Y’) as insertDateTime FROM table WHERE insertTimeStamp BETWEEN DATE_SUB(NOW(), INTERVAL 1 MONTH) AND DATE_ADD(NOW(), INTERVAL 1 MONTH)SELECT *, DATE_FORMAT(insertTimeStamp, ‘%d-%m-%Y’) as insertDateTime FROM table WHERE insertTimeStamp BETWEEN DATE_SUB(NOW(), INTERVAL 1 MONTH) AND DATE_ADD(NOW(), INTERVAL 1 MONTH)

MySQL: date_format with correct locale

$sql = ‘SET lc_time_names = "nl_NL"’; $result = @mysql_query($sql); $sql = ‘SELECT title, DATE_FORMAT(insertdate, "%d %M %Y") insertdate FROM table’; $result = @mysql_query($sql);$sql = ‘SET lc_time_names = "nl_NL"’; $result = @mysql_query($sql); $sql = ‘SELECT title, DATE_FORMAT(insertdate, "%d %M %Y") insertdate FROM table’; $result = @mysql_query($sql);

MySQL: group_concat

GROUP_CONCAT returns a string result with the concatenated non-NULL values from a group. It returns NULL if there are no non-NULL values. You can get the concatenated values of expression combinations. To eliminate duplicate values, use the DISTINCT clause. The default separator between values in a group is comma (“,”). To specify a separator explicitly,
Continue reading MySQL: group_concat