Entries Tagged 'PHP' ↓
July 31st, 2008 — Experiences, PHP, Technology, Writing and Speaking
I’ve been playing with a few open source CMSs for my new book. And I am actually surprised! Most of them are just so darn difficult to use! Not only they are jargon filled, but they are also unintuivie!
I am looking at both user side and the admin side.
I think WordPress excels in usability. The design is good, and it’s easy to figure out how things are laid. It follows task-centered approach to design. Which is great.
Joomla is confusing. The action buttons are above the form where you fill in the information. That’s very sad. The content adding interface is overly complicated and difficult for an intermediate user too.
Drupal makes me feel I have landed in wonderland! The taxonomy and nodes tangle me! And where is the WYSIWYG interface? That should be on by default!
What’s been your experience? Which CMS is best in terms of usability?
June 6th, 2008 — Mobile, PHP, Writing and Speaking
One of the biggest hurdles in mobile web development is to make the site usable on different devices. You can follow the least common denominator approach and use only those features that will work on all target phones. But many a times you want to take advantage of device specific features in your mobile web.
What do you do then?
Well, you adapt the design and content to the device! And how do you do that?
Read the Chapter 4 of my Mobile Web Development book! It shows you exactly how to adapt your XHTML MP based mobile website to different devices using WALL, WURFL etc.
Here’s the chapter outline:
- What is Adaptation?
- Do I Need Adaptation?
- Can’t I just Use Common Capabilities and Ignore the Rest?
- How to Determine the LCD?
- OK, So How do I Adapt?
- Fancy Pizza Selection
- What are Those <wall:*> Tags?
- Let’s Make Sense of This Code!
- Can I Use All XHTML Tags?
- Will This Work Well for WML?
- Device Detection and Capabilities
- XML Processing can Bog Down My Server, is There Something Easier?
- What About W3C’s DIAL?
- Other Useful Tools for Adaptation
- Dynamically Resizing Images
- Quick and Easy Way to Make Your Blog Mobile
- MyMobileWeb: Going the Semantic Way
- HAWHAW: As Simple as a Laugh?
Click on the image below to download the free PDF.

January 10th, 2008 — GNU/Linux, PHP, Technology, Updates
The latest version of our GPL product ContactGrabber now allows you to fetch contacts from 10 different sites.
- AOL (new)
- LinkedIn (new)
- Lycos (new)
- IndiaTimes (new)
- Yahoo
- Orkut
- Gmail
- Rediff
- Hotmail
- Myspace
ContactGrabber allows you to retrieve the address book contact information from various sites. If you are developing a site and need your users to import their contacts from other sites, or recommend you to their contacts, this is a great solution!
ContactGrabber is developed in PHP and is released under GPL.
Note: As of now, Gmail has an issue with some email accounts. They are moving accounts from one server to another and that’s what is causing the problem. This should be corrected soon.
Download ContactGrabber from: https://sourceforge.net/projects/contactgrabber
The code has been contributed by Magnet’s Mumbai and Ahmedabad teams! Great work guys!
December 7th, 2007 — Business, PHP
There is an interesting assignment we have and we need good PHP programmers who can understand and speak Japanese. It’s an onsite assignment. If you are interested, send an email to “vishal dot kothari (at) magnettechnologies.com”.
October 31st, 2007 — PHP, Technology
I am stuck onto a problem and would appreciate some help on this! Here's the problem:
I am using aggregate functions (eg. SUM) of MySQL in a query where two tables are joined. I also need to filter the results based on some WHERE clause. Now the problem is, SUM sums up the values multiple times since one row from one table repeats due to the join.
Let me explain with an example. Suppose the two tables I am working with are transactions (T) and transaction_products (TP). T stores the details of the transaction (date, total price, discount, customerId etc) and TP stores line item details (productId, item price, item discount etc). And I want to get the total sales for an order where a particular product was sold.
Here's what I do:
SQL:
-
SELECT SUM(t.totalPrice), tp.productId FROM transactions t, transaction_products tp WHERE t.id = tp.transId GROUP BY tp.productId
Now that does not work correctly. And even when I simply want to get the total sales for all orders, the query becomes
SQL:
-
SELECT SUM(t.totalPrice) FROM transactions t, transaction_products tp WHERE t.id = tp.transId
And this is wrong! It joins the two tables, and repeats the totalPrice in the result, and sums up those values. Resulting in a much larger sales than the actual
How to solve this?
You can say that we can avoid the join where we want to SUM on a field from T, but that would not help in a condition like this:
SQL:
-
SELECT SUM(t.totalPrice), tp.catId FROM transactions t, transaction_products tp WHERE t.id = tp.transId AND t.transDate BETWEEN "2007-01-01" AND "2007-10-31" GROUP BY tp.catId
If I sum up all the result rows of the above query, the result is about 3 times higher than this:
SQL:
-
SELECT SUM(t.totalPrice) FROM transactions t WHERE t.transDate BETWEEN "2007-01-01" AND "2007-10-31"
And the problem is that I need the category Id (or some other field from TP table)!
Any solutions to this?
I thought of derived tables (as mentioned here) but that does not solve the problem.
I thought of splitting the query in two parts. Storing the results of SUM in a temp table and then doing the WHERE clause - but that would fail outright since the results do not include the WHERE condition.
What else can I do? What do you think?