I was thinking of writing a little tutorial on PHP objects but there is an excellent one available at Nettuts. As a brief example though, PHP is frequently used to connect to a MySQL database. In the past, I would have used code such as this example also from Nettuts:
'Could not connect: '
There is now an object orient equivalent which uses the PHP Data Object or PDO:
Using the PDO method, you need to prepare your database query with placeholders if need and then execute them. Although this adds an additional step, it makes SQL injection(attacks where strings are added to the query ) attacks virtually impossible.