How to: Convert MySQL Hierarchical Data Flat List Result to Multi-Dimensional PHP Array

 Recently, for a fun stuff, I came across a need of an infinite level of categories. I stumbled upon Gijs Van Tulder‘s article of “Storing Hierarchical Data in a Database” at SitePoint. Based of Van Tulder article I’m experimenting on my localhost. Below is the contents of my ‘categories’ table: +—–+——-+——–+———-+——+——+ | id | title […] Continue reading →

How to fix: Squid cache_dir (13) Permission denied

 I was configuring a newly installed Squid cache on newly installed CentOS 5.2 to use a new partition for it’s cache dir. Squid version: [root@localhost ~]# squid -v Squid Cache: Version 2.6.STABLE6 configure options: ‘–build=i686-redhat-linux-gnu’ ‘–host=i686-redhat-linux-gnu’ ‘–target=i386-redhat-linux-gnu’ ‘–program-prefix=’ ‘–prefix=/usr’ ‘–exec-prefix=/usr’ ‘–bindir=/usr/bin’ ‘–sbindir=/usr/sbin’ ‘–sysconfdir=/etc’ ‘–includedir=/usr/include’ ‘–libdir=/usr/lib’ ‘–libexecdir=/usr/libexec’ ‘–sharedstatedir=/usr/com’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–exec_prefix=/usr’ ‘–bindir=/usr/sbin’ ‘–libexecdir=/usr/lib/squid’ ‘–localstatedir=/var’ ‘–datadir=/usr/share’ ‘–sysconfdir=/etc/squid’ […] Continue reading →