Fosstodon Mastodon

Articles tagged under PHP


[PHP/Codeigniter] Getting multi-queries right with SQLITE

My earlier article dealt with multi-query issues of MySQL, this one is dedicated to SQLITE. Multi-queries are often discouraged to begin with but there are times when you find yourself using them. One typical use case is populating the database initially when it's empty. You do this by running an … Read More

[MySQL] Setting default date to current date

The most typical way people set default values to mysql date fields is by using the CURRENT_TIMESTAMP constant as follows: create table ledger_entries ( id int(11) not null auto_increment, entry_date datetime default CURRENT_TIMESTAMP ); This will obviously work if you need both date and time parts in the value. But in … Read More

[PHP/Codeigniter] Playing with multi-queries in MySQL

Multi-queries are often discouraged with mysqli functions but there are times when you must use them. One obvious use case is initializing the database. One of the first things your app must do is determine if the database tables exist or not, and then run an initializing SQL script if … Read More


Wordpress to Pelican in 24 hours

Today, I finished migration of my blog from a self-hosted Wordpress site to a statically hosted Github Pages site. For the static site generator, instead of choosing Jekyll which is a hot favorite of rubyists, I went for Pelican instead as I figured my Python skills might be somewhat useful … Read More




How to create a Google Drive App in PHP

This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access files/folders on behalf of your logged-in users. One of the basic tasks here is to authenticate to google and access … Read More

Farewell Wordpress, Hello Jekyll!

Here I am, signing off from a self-hosted, over-bloated Wordpress site and finding a welcome change in Jekyll, a blog-aware static site generator. There is nothing new about this, several well-known bloggers have already migrated to Jekyll in the last few years including Rasmus Andersson, Nick Quaranto and Roger Chapman … Read More

Page 1 / 2 »