I’ve switched a couple of years ago to PDO to manage all the database actions. PDO (PHP Data Objects) is an object orientated extension that requires at least php 5.1. In many cases software improves and is often more easy to use. But why did the php development-team forgot to write a similar function like mysql_num_rows?
In this case you always need to run an extra query to retrieve the total records. See the examples below.
Continue Reading »
For programmers who are starting with mysql a couple of tips to make life easier. A small list of basic tips beside the most important one: Use an error handler!
Continue Reading »
When you’re building a application with php and a MySQL database you can run into trouble when you don’t have a nice error handler. This article describes the minimum of a error handler.
The principles
- Run the query with php
- See if there is an error with the query
- Display the error while the rest of the script don’t dies!
Continue Reading »