PHP PDOStatement: bindParam vs bindValue

PHP PDOStatement: bindParam vs bindValue

It’s commonplace to repeatedly execute a query, with each iteration using different parameters. However, doing so using the conventional query() method and a looping mechanism comes at a cost of both overhead, because of the repeated parsing of the almost identical query for validity, and coding convenience, and the need to repeatedly reconfigure the query using the new values for each iteration. Using prepared statement eliminate this problem. Thankfully, it is easy to accomplish in PHP … [Read more...]

Fix to SQLite 3 – General error: 25 bind or column index out of range

PHP PDOStatement: bindParam vs bindValue

Few days ago, I decided to build my own minimalistic Feed reader using SQLite3 for the backend and SimplePie - a very fast and easy-to-use feed parser, written in PHP. Note: I am using PDO as my database abstraction layer. I wrote the PHP class to connect to the SQLite database and a method that contains the SQL query that will insert records to the DB. When I check to ensure the code wasn't going awry, it indeed was as I got this error message: General error: 25 bind or column index … [Read more...]

Adding Facebook Social Plugins to WordPress the Geeky Way

Adding Facebook Social Plugin to WordPress the Geeky Way

The Facebook Send Button is one social network plugin I can't do without. Since ditching Hootsuite, I have been using it, to send / share my blog content to numerous number of friends in a Facebook message, to email addresses, and to the various Facebook group just with a click away. Unlike the Like button, the send button can't auto-detect the current URL of a webpage, i.e. you need to specify an absolute URL of the page that will be sent. Using WordPress the_permalink() function, you … [Read more...]

How to fix SimplePie’s – Warning: cache is not writeable

How to fix SimplePie's - Warning: cache is not writeable

Few weeks ago, I wrote a WordPress plugin that displays recently published articles queried from WordPress feed using SimplePie (Yet to be released). Wondering what Simple is? Well it is a free, fast and easy-to-use feed parser, written in PHP that handles all of the dirty work when it comes to fetching, caching, parsing, and sanitizing the resulting data. After I had finished writing the plugin, I tested to confirm if it was working perfectly and indeed it worked but there was a minor bug … [Read more...]

How to Build a Scraper site with Blogger and WordPress

RSS feed to WordPress IFTTT recipe

A scraper site is a spam website that copies all of its content from other websites using an underlying technology or software that simulate humans’ exploration of the internet. The purpose of creating such a site can be to collect advertising revenue or to manipulate search engine rankings by linking to other sites to improve their search engine ranking. In my previous post, I mentioned my ordeal with a scraper site ( hosted on the blogger platform ) that was consistently ripping off or … [Read more...]

Review of Beginning Yii [Video]

Beginning Yii [Video] - review

Few months ago, I receive this video course Beginning Yii from the Packt Publishing team in exchange for a review on it. Yii is a free, open-source Web application development framework written in PHP5 that promotes clean, DRY design and encourages rapid development. It works to streamline your application development and helps to ensure an extremely efficient, extensible, and maintainable end product. I have been looking forward to learning the Yii framework for a long time, I couldn't … [Read more...]

Playing with ROT13 Encryption

ROT13 introduction

Few days ago, I decided to build something. I ended up building a lite CMS for sharing jokes and stories with friends and foe :D It still in private Beta and I really do not know if I will be open sourcing it as it is kind of too basic. I wrote a filter for the CMS that encrypt or encode abusive words using ROT13. For example: "f*ck you" becomes "shpx lbh" Introduction to ROT13 ROT13 ("rotate by 13 places") is a simple letter substitution cipher that replaces a letter with the letter 13 … [Read more...]

How to Detect if a Browser has Javascript OFF

When javascript is OFF

Using the <noscript> HTML tag, you can display a notification to your website users when they have JavaScript disabled or turned off in their web browser. Below is a noscript code example and its output. [html] For full functionality of this site it is necessary to enable JavaScript. Here are the Instructions to enable JavaScript in your web browser. [/html] To learn how to toggle JavaScript off and ON in your web browser, head over to enable-javascript.com. … [Read more...]