Archive: Programming

So Many Work, So Little Time

I would like to thanks everyone for all the feedback regarding The Future of FeedMalaya. Yes we are going GPL, at the moment we already have some draft plan to be executed but it will take some time, opening our source code alone will not make the developer community to improve the project.

What we need to do is build a solid foundation so that developers will improve the feature based on current foundation or base code instead of forking the project to another name. Don’t get me wrong, in GPL there no issue of forking one project into another but at the moment we still want FeedMalaya to grow instead just a name.

Posted in FeedMalaya | 2 Comments

The Future of FeedMalaya

Some of you might have already come across FeedMalaya, a project that me and Mohd Huzairy did more than a year ago. It’s was a project that we did for fun and at the time the wasn’t any real business plan that we build from the project. So over this period of time we how far can a web application survive in term of performance, mind you the application is currently running on just a single shared hosting service under IPServerOne.com.

Continue reading…

Posted in FeedMalaya, Thought | 4 Comments

CodeIgniter for Oracle: ADOdb Database Abstraction vs CodeIgniter Database Library

Early last year, I got the chance to learn and develop a huge web application using CodeIgniter PHP Framework. It was my first project using the framework so at that time we have decided to avoid using CodeIgniter default Database Library in fear of incompatibility with oci8 or Oracle10g.

Only afterward did I got a chance to test out CodeIgniter Database Library or ActiveRecord Library on project using MySQL. At this point, the simplicity of ActiveRecord really caught my attention but how would it be enough compared to ADOdb when using Oracle Database?

Continue reading…

Posted in ADOdb for PHP, Best Practices, CodeIgniter, Oracle | 1 Comment

Comparing Today Date in MySQL

Conventionally getting today date from database in the past would require the use of date('Y-m-d'); function and add it to MySQL query such as below:

$today_date = date('Y-m-d');
$tmrw_date = date('Y-m-d', strtotime("+1 day"));
$sql = "SELECT * FROM my_table
    WHERE my_datetime BETWEEN '" . $today_date . "' AND '" . $tmrw_date . "'";

However this method might return false positive result if the web server and database server doesn’t have it date and time synchronized. From my point of view, it best to let the database server have the full control to insert, update or compare the dates. So what the alternative? You can check the full specification from MySQL Date and Time Functions but I would opt for DATEDIFF if you specifically want to compare with today date.

SELECT * FROM my_table
    WHERE DATEDIFF(my_datetime, SYSDATE())=0
Posted in Best Practices, MySQL, Tutorial | 2 Comments

Add Additional Cookie on WordPress

wordpress-logo
Today I realize that the simple setcookie("sevisitor", 1, time()+3600); would not work perfectly on WordPress especially when your combine it with WordPress permalink. Here a simple hack that you can opt for if you want to set in multiple WordPress environment (especially for plug-ins and themes).

setcookie("sevisitor", 1, time()+3600,
    SITECOOKIEPATH, COOKIE_DOMAIN, false, true);

There are multiple alternative for it but this work perfectly on multiple installation.

Posted in How-To, WordPress | 4 Comments