Category Archives: Tutorials

What is the point of learning a lot but never sharing that newfound knowledge with others in order to spread awareness around? Knowledge is for all and so if I come across some technique or instructions that I wish to safeguard for the future, where better to leave it lying around than on the World Wide Web for all to access?

FPDF: Failing to Insert a Google Chart into a PDF

My tried and trusted method for inserting graphs into PDFs is to use the nifty PHP FPDF library and insert an image into it via a Google Chart URL.
Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , | 2 Comments

MySQL and XAMPP: Change Your Server’s Max Allowed Packet Limit

Just a quick note on how to permanently change your MySQL server’s configuration to allow for a bigger max_allowed_packet limit, basically the variable that controls how long a SQL statement can technically get. Continue reading

Posted in Software & Websites, Tutorials | Tagged , , , , , | Leave a comment

MySQL: Got a packet bigger than ‘max_allowed_packet’ bytes Error

I came across a nasty little bug in my image upload to MySQL blob in base 64 encode function the other day – basically the database was spitting back the following error to me: Error code: 1153 – Got a … Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , | Leave a comment

PHP: Write to Text File

Just a simple code snippet to remind myself just how easy it is to spit out content into a text file using PHP. $myFile = “testFile.txt”; $fh = fopen($myFile, ‘w’) or die(“can’t open file”); fwrite($fh, “Text sentence for line 1\n”); … Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , , | Leave a comment

PHP: Merge Two Arrays but Keep Their Keys Intact

Combining two or more arrays whilst keeping their keys intact in PHP is deceptively simple – though not if you assume you need to use a function like array_merge to achieve this! As you scroll through the various array functions … Continue reading

Posted in Tutorials | Tagged , , , , | 8 Comments