Friday, November 28, 2008

Quick and Easy Graphing with the Google Chart API

Google has created an API for displaying the data in terms of chart which will be helpful in visualizing the data for reporting.For more details head over at http://www.sitepoint.com/blogs/2008/11/28/quick-and-easy-graphing-with-the-google-chart-api/

Tuesday, November 25, 2008

Application Configuration

PHP applications come in many shapes and sizes. Some used locally from command line, and more commonly, for web based applications. More often than not, regardless of size or type, some form of configuration variables will be stored for global access. Usually these configuration options are held in one of these four types of containers.

* ini file
* XML file
* PHP file
* Database

Each options has its pros and cons. Here each of these options is explored to see which method is right for your application.

For more details head over at http://www.phpro.org/articles/Application-Configuration.html


Tuesday, November 18, 2008

GROUP_CONCAT in MySQL

I had the scenario for the table like below.

Table: test

id title
_________________

1 T2
1 T3
1 T1
2 L2
2 L1

I want the results like

id title
_________________

1 T2,T3,T1
2 L2,L1


For this, SQL would be

select id,GROUP_CONCAT('title') from test GROUP BY id ORDER by id


Now i want the values of title to be sorted.

This can be done using the below query

select id,GROUP_CONCAT('title' ORDER BY title) from test GROUP BY id ORDER by id

The results would be

id title
_________________

1 T1,T2,T3
2 L1,L2