Category: MySQL

Create your own MySQL query profiler in PHP

Do you know how many times your PHP scripts are calling the database or how long time the queries take to execute? Maybe it’s time to create your own query profiler? It’s simpler than you might think. There are several ways of doing it but we’ll look into one example here based upon a previous




How to automatically recover from an MySQL SERVER HAS GONE AWAY error

The error message is very self explaining – the program lost connection to the server. The reason for this error is quite often simply that the script took longer time to execute than the time-out settings in the connection. In PHP there is a simple command to check if the database connection still is open:




Converting BLOB in MySQL

Blob is a format used in MySQL to hold binary data (binary large objects). Blobs are treated as binary strings but has no character set information. Normal text is treated as character strings with character set information stored. If you want to use a blob you therefore have to know what character set it’s coded




%d bloggers like this: