Programming

Featured
PHP
Programming
Technology
Wordpress

How to Fix “PHP Fatal error: Allowed Memory Size of xxx Bytes exhausted…” on WordPress

PHP has a default memory limit of 8MB which is set in php.ini file. If your .php script exceeds more than the limit it will throw “PHP Fatal Error Allowed Memory Size Exhausted”. To settle this problem, you can add one line code in the beginning of your script: or, add in the following code […]

Read More
Open Source
Programming
SQL
Tips and Tricks

Select Case Sensitive in MySQL

Today I found bug on my website while using MySQL query. I just realized that the search function works in case insensitive. If I execute this query: SELECT filename FROM data_ebook WHERE filename = ‘Manasik_Haji_dan_Umroh.pdf’ the results will be: — Manasik_Haji_dan_Umroh.pdf Manasik_Haji_Dan_Umroh.pdf — By using keyword ‘LIKE BINARY’ it can make the result case sensitive: […]

Read More
Open Source
Programming
Tutorial

Pad Number with Leading Zero in Javascript

The following function will pad number with leading zero(es). function pad(number, length) { var str = ” + number; while (str.length < length) { str = ‘0’ + str; } return str; } Some code to test the function: document.write(pad(1, 1) + ”); document.write(pad(1, 2) + ”); document.write(pad(15, 2) + ”); document.write(pad(1, 3) + ”); […]

Read More