MySQL Backups with a Command Line PHP Script

I run a number of web servers with PHP and MySQL and have a PHP command line script that runs on a daily basis to back up MySQL databases using the mysqldump command. It would be possible to do this using a simple bash script as well, and I know I used to use a bash script in the past but for some reason switched it to PHP at some stage.

Triggering errors with PHP

It is possible to trigger an error in PHP. This can be useful for debugging purposes, or if there is some condition which occurs in your PHP script which requires a PHP notice, warning or full error which causes the script to halt execution, and which would not be generated by PHP itself.

Categories PHP

Formatting Dates with PHP

PHP has a really useful date() function for formatting dates from timestamps. When used in conjunction with strtotime() you can do some really quick and easy manipulation and formatting of dates.

Categories PHP

Using strtotime with PHP

The strtotime() function in PHP allows you to convert English text date time strings into UNIX timestamps. It is useful for converting database datetime strings into UNIX timestamps and also creating dates into the future or past based on the current time or relative to a date and time in the future or the past. This post looks at some examples of doing this.

Categories PHP

Get unique array values with PHP

The PHP function array_unique() allows you to create a new array which contains only the unique values from the original array. This post looks at some examples of using the array_unique function.

Categories PHP

phpMyAdmin

phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL using a web browser and is one of the most active projects on Sourceforge.