sample code using jquery, php, json and mysql