Category Archives: MySQL

PHP Fatal error: Out of memory – Prevention better than Cure

While running a PHP script you may encounter the dreaded “Fatal error: Out of memory” message. It is usually be accompanied with a few long numbers which represent the number of bytes the script tried to allocate. The obvious fix … Continue reading

Posted in MySQL, Performance, PHP | Comments Off

List MySQL users with access to a certain database

It can be hard to keep track of all the users you have setup in MySQL. In some cases, a user will have access to multiple databases, with different levels of permission. As part of a security review, you may … Continue reading

Posted in MySQL | Comments Off

Calculate how many hours between 2 dates using MySQL

Using the correct field types in your database allows you to take advantage of the built in date and time functions in MySQL. The MySQL manual is always a little sparse on real world usage, so here is an example! … Continue reading

Posted in MySQL | Comments Off