Sample code for serializing and storing PHP objects in an SQL database