PHP-MySql: Select previous row and next row from current ID
During the dark age, the simplest way to get previous row from current ID was using this query: SELECT field1 FROM tablename WHERE id = ($currentId – 1) and to get next row: SELECT field1 FROM...
View ArticleReset Mysql Root Password
Terrible, just setup a new server, then i forgot root password for mysql database. So i need to reset the root password. This is the way i do: 1. Login to our server machine as root (system...
View ArticleRestore Ubuntu Boot Loader
To repair your Ubuntu GRUB, you need Ubuntu LiveCD, boot from this CD, and open a terminal. Be a root, by typing “sudo su” and enter your password. Find the partition which your Ubuntu system is...
View ArticlePHP-GD: Create Image from Text
Some people want to hide their text into image for any reason. As example, to avoid spambot steal their email address, or to generate dynamic images content. Its simply done with PHP and GD Library....
View ArticleSubdomain wildcard pada Ubuntu dengan bind9
Ada kasus seperti ini, kita akan membuat sebuah website komunitas yang nanti nya para pengunjung bisa mendaftar sebagai anggota. Dan setiap anggota masing-masing akan mendapatkan alamat URL:...
View ArticleSubdomain wildcard pada Ubuntu dengan bind9 – Part II
Menyambung artikel sebelumnya, kali ini kita akan membuat konfigurasi Virtual Host agar setiap request yang masuk langsung diarahkan ke domain utama. Pertama, edit file konfigurasi default apache:...
View ArticlePHP: Procedural vs. Object Oriented Coding Style
PHP allows you to write code in two flavours, one is procedural and the other is object oriented. You can even write procedural code in PHP5 and it will run without any problems. If you are not clear...
View ArticleMysql String Functions
Name Description ASCII() Return numeric value of left-most character BIN() Return a string representation of the argument BIT_LENGTH() Return length of argument in bits CHAR_LENGTH() Return number of...
View ArticlePHP-GD: Resize Transparent Image PNG & GIF
By default, you will get black background if you resize a transparent image. To fix it, you need set alpha channel imagecolorallocatealpha to 127. With imagecolorallocatealpha, it will allocate a color...
View ArticleBlogging via Google Docs
Selain untuk membuat dokumen, Google docs juga bisa untuk menulis blog, yang kemudian otomatis akan di posting di situs blog anda seperti: Blogger.com, livejournal.com, WordPress.com, dan lain nya....
View ArticleWordPress Error: The plugin generated 1 characters of unexpected output...
This problem gave me a headache for a couple hours, just to found out that there was a white space before <?php. Next time you have this error too, check if there’s a white space before or after the...
View ArticleConvert PHP object to an array recursively
PHP: How to convert multi-dimensional / nested objects into an associative array recursively
View ArticleHow to Upgrade PHP 5.3 to PHP 5.6 on CentOS 6
Follow this post to install PHP 7 to your CentOS 6 Nowadays, to keep up up-to-date with the latest PHP technology, you need at least PHP version 5.6 installed on your server. But for CentOS 6 users,...
View ArticleHow to reset MySQL 5.7 root password on Linux
I was having problem with MySQL root password after a fresh installation on CentOS 6. I cannot login to mysql as i didn’t know what was the default password for root. The installation didn’t prompt me...
View ArticleHow to Install PHP 7 on CentOS 6
Previously i posted about upgrading PHP 5.3 to PHP 5.6 on CentOS 6. If you want to install / upgrade it to PHP 7, here’s how: 1. Make sure to remove older version of PHP yum remove php-common 2. Add...
View Article