Tag Archives: php

PHP Bug with DateTime diff

After PHP 5.3.0 DateTime::diff was introduced to help with the comparison between two DateTime objects. However it still seems to be a bit buggy. While I was developing a statistics tool and trying to group occurrences by month, I got … Continue reading

Posted in Bugs, Solutions | Tagged , , , , , | 7 Comments

PHP script to convert mysql collation

Whenever you have accidentally chose a wrong collation or changed your mind afterward you may use the following script to change the collation (the character set that data are stored) automatically. This is especially useful when for example you want … Continue reading

Posted in Scripts | Tagged , , , , , | Leave a comment

MySQL query is not executed, MySQL server has gone away

Problem: I was trying to make a mysql query after a function, that was taking a lot of time to load, and my query was not being executed. In addition I was receiving the error: “MySQL server has gone away”. … Continue reading

Posted in Solutions | Tagged , , , | 4 Comments

vbulletin 4 make bbcode [code] have syntax highlight like [php]

Goal #1: vbulletin 4 bbcode [code] have syntax highlight like [php] Goal #2: Code wrapped in the [code] and [php] bbcodes to have Consolas as font like StackOverflow The default [code] bbcode of vbulletin doesn't highlight the code which is … Continue reading

Posted in Scripts, Solutions | Tagged , , , , | 23 Comments