If you have ever had a chance to use a PHP active record class for MySQL, you would notice that most of them don’t support complex where statements. I’ve had a chance today to address this feature request that I was received from a user of my PHP MySQLi wrapper class.
Adding a complex WHERE clause is now simple.
$db->or_where('foo <', 15);
$db->where('bar >=', 15);
// Produces SELECT `column` FROM `table` WHERE `foo` = 15 OR (`foo` < 15 AND `bar` >= 15)
For more information on this class and download it, visit the repository on Bitbucket.
One of the main reasons why I like JIRA is its integration with BitBucket, the free Git repository service. Both JIRA and BitBucket are from Atlassian, the company behind many other great products. Recently I started using JIRA for all my project works. It works very well. JIRA has hosted version available for $10/month ( $20/mo with Agile addon ). Two reasons why I don’t like the hosted edition are
1. No support for custom URL. We have to use their subdomain ( such as https://something.atlassian.net )
2. Monthly recurring payment of $20.
Paying $20 for a project management tool with a total user base of one or two users, is waste of money. So I’ve decided to buy JIRA and host it on my own server. Atlassian offers JIRA server edition for $10 one time and JIRA Agile addon for another $10 onetime. So I purchased JIRA + Agile for $20. There is no monthly payment if you host JIRA on your own server. The next task was to get a VPS to install JIRA. (more…)
Last December, I wrote a simple and easy to use PHP MySQLi wrapper class inspired from the simplicity of Code Igniter Active Record pattern and hosted on BitBucket. Over an year, I’ve been using this class and continuously improving it based on my requirements and other users requests. Over a dozen of bug fixes and improvements made based on user reporting so far.
The latest version has been released ( 1.4.6 ). This includes new methods FIND_IN_SET to find a value from a comma separated string and BETWEEN condition.
// Produces: SELECT * FROM tblinvoices WHERE FIND_IN_SET ('305', orders)
$db->where('id', 5)->find_in_set('503', 'orders')->from('tblinvoices')->fetch();
// Produces: SELECT * FROM tblinvoices WHERE id='5' AND FIND_IN_SET ('305', orders)
$db->where('id', 5)->find_in_set('503', 'orders', 'OR')->from('tblinvoices')->fetch();
// Produces: SELECT * FROM tblinvoices WHERE id='5' OR FIND_IN_SET ('305', orders)
between('created', '2014-05-05', '2014-05-10');
// Produces: created BETWEEN '2014-05-05' AND '2014-05-10'
$db->from('tblinvoices')->where('clientid', '12')->between('created', '2014-05-05' , '2014-05-10')->fetch();
// Produces: SELECT * FROM tblinvoices WHERE clientid = '12' AND created BETWEEN '2014-05-05' AND '2014-05-10'
Download the latest version
I welcome comments and suggestions on this wrapper class and hope you will find it useful.
Yesterday, December 8th, 2014 I took the Zend Certification exam and passed. The latest version of the Zend exam is based on PHP version 5.5. They have updated their syllabus to reflect this change. And also, Zend made their official study materiel available to buy from their website for $19.95. It was available free of cost before.
I took the decision to write the Zend certification about 2 years back. But things have changed so quick in my life that I couldn’t even prepare for the exam. I’ve seen a lot of posts on the internet about the tricks and tips to pass this exam, and a bunch of sample questions. So I am not going to write similar post. If you would like to pass the exam, here is my suggestion
Study Strings and Arrays thoroughly. Don’t just read those pages, write the code and try to execute. Use a pen and paper if you need. If you study almost all functions mentioned on those pages, you will certainly get 50% of the pass mark.
In addition to those, here is what I found, will give you additional points.
Today I am going to share a small trick that would save you $50-$100 every month you are paying to your current home internet provider. I did not want to do 2 year agreement with Verizon FiOS, as I will be moving to another city within a month, so I found this setup works for me.
Basically, what you are trying to do is to tether your T-Mobile/MetroPCS unlimited internet plan and connect it to your router. By connecting any device to the router you can access internet on that device.
This method is helpful, when you have a XBox or Roku or any such devices connected to your TV and stream music and videos.
Here is what you require.