Blog Archives

MSSQL and MySQL resources go here

BBC iPlayer alerter – Part 3: Email

Before reading this article you should read the previous two posts of this series: BBC iPlayer alerter – Part 1: JSON processing, and BBC iPlayer alerter – Part 2: Data storage. The final thing I had to prove was that I could

Posted in Python, Raspberry Pi, SQL

BBC iPlayer alerter – Part 2: Data storage

Before reading this article you should read my first post of this series: BBC iPlayer alerter – Part 1: JSON processing before you dive into this one. You will remember that for step 2 of my plan to automate detection of

Posted in Linux, Python, Raspberry Pi, SQL

Update a MySQL column trimming a constant number of characters

Will remove the first 4 characters. E.g. ABCD1234, ABCD1235 -> 1234, 1235: UPDATE table_name SET title = RIGHT(column_name, CHAR_LENGTH(column_name) – 4) WHERE clause;

Posted in SQL

PHP/MySQL dates

I have posted before as to a MySQL date, i.e. Y-m-d can be converted in a previous post here. I found myself this evening in need of converting UK dates back into the MySQL format. Now, the strtotime() function requires

Posted in PHP, SQL Tagged with: , , ,

Converting stored MySQL dates into UK format

You will no doubt be aware that when you save a date in a MySQL database, it must be in the form of Y-m-d. I had some difficulty wrestling with the date() section of the PHP manual , and experimented for

Posted in PHP, SQL Tagged with: , ,

Automatic MSSQL 2008 Backup Batchfile

I was asked to create a simple process for backups to a MSSQL database. After a little searching around online I came up with a Windows batchfile, and then used scheduled tasks to run it weekly: set ToDaysDate=%date:~3,2%%date:~0,2%%date:~6,4% “C:Program FilesMicrosoft

Posted in SQL Tagged with: , ,