
The Internet has drastically transformed the way we look at life. Business, politics, even society itself has been turned upside down by the Internet, and all in the last few decades. Whereas a decade ago, websites were only for the most avant garde businesses and networks, today it is seen as naive for even the plainest individuals to go without one. Having a website keeps you on the cutting edge as a cyber-conscious individual.
Having your own website does something for your online, worldwide personality that is way out of the league of common social networking sites such as Facebook and Twitter. It gets you out to the world in a charming, efficient way that says, “Check me out! I’m different!” And the good news is it’s not even that hard to make your own. Below, we’ve compiled a few pointers to help you get started on your own personal, world changing website.
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…
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

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.
Yes, I have a problem with CodeIgniter built-in Form Validation Library, the lack of direct Regular Expression test/rule is a huge turn off for me especially when I need to use Regular Expression to as a rule to verify user input.
There are alternative with the use of “callback” to by creating an additional method inside your Controller. The solution is good if you have a complex filtering but why bother when all you need to do is a simple RegExp verification. Based on my Twitter status:
Continue reading…