php

How to Insert Data with PHP PDO

Here’s one way to insert a record using PHP PDO into a MySQL database. $dbh = new PDO(‘mysql:host=localhost;dbname=myfunkydata’, ‘dbusername’, ‘dbpassword’); $dbh->beginTransaction(); $sth = $dbh->prepare(“INSERT INTO recording(name, date) VALUES(?, ?)”); $file = time(); $sth->execute(array($file, date(‘Y-m-d H:i:s’, $file))); $dbh->commit();

How to Create PHP PDO MySQL Connection

Here’s how I create a PDO connection to a MySQL database. $dbh = new PDO(‘mysql:host=localhost;dbname=myfunkydata’, ‘dbusername’, ‘dbpassword’); $dbh->beginTransaction(); $sth = $dbh->prepare(“INSERT INTO recording(name, date) VALUES(?, ?)”); $file = time(); $sth->execute(array($file, date(‘Y-m-d H:i:s’, $file))); $dbh->commit();

Upgrading Debian Squeeze to Wheezy

I’ve recently done a few upgrades of Debian from Squeeze to Wheezy and it’s a pretty uneventful process. I recommend following these instructions at HowtoForge. The only major issue was that Mysql was removed after the upgrade. My data was still there but I had to install mysql-server. apt-get mysql-server Also you might get an Upgrading Debian Squeeze to Wheezy