Error reporting with PHP

When you are working on your website, you will sometimes want to change the level of error reporting that your code returns. This is a great way to get full diagnostic information to fix a problem in your latest piece of code, but be careful only to show error reporting on your test site and…

Ignore User Aborts with PHP

When you are developing or supporting a website, it does not always work perfectly. Sometimes a visitor will abort a script that is running, and when that happens, you want to try and avoid that causing a client disconnect. The ignore_user_abort() function determines whether the remote client can abort the running of the script. This…

MySQL Random Row

To get a random row from your table, you can use the following trick: This will return a single random row from myTable. Remember that you can also use a WHERE clause to narrow down the records before choosing a random one. This is a more efficient way of finding a random result than it…