July 31, 2012

Database Optimization Experience – Rackspace Cloud

Database Optimization Experience – Rackspace Cloud Conversation: Hello, It has come to our attention that the database xyz has been running some queries that take an extremely long time to complete and have started to become detrimental to the shared resource that the database is hosted on. At this time, we have not imposed any […]

July 23, 2012

MySql – how to remove on update current_timestamp

Example: Table Name: tbl_user Field Name: user_created Solution: ALTER TABLE tbl_user CHANGE `user_created` `user_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP

July 10, 2012

Fetch your tweets with PHP

Fetch your tweets with PHP PHP Function: Filename: tweets_code.php function tweets() { $q=’phpFlex’; $tweets = file_get_contents(‘http://search.twitter.com/search.json?q=’.$q.’&rpp=2&include_entities=false&with_twitter_user_id=true&result_type=recent’); $tweets_obj = json_decode($tweets); $return = array(); if(count($tweets_obj)>0) { if(isset($tweets_obj->results) && count($tweets_obj->results)>0) { foreach($tweets_obj->results as $key=>$result) { $return[$key][‘text’] = $result->text; } } } echo json_encode($return); } Javascript Functions:   function get_tweets() { var tweets_url = ‘tweets_code.php’; $.get(tweets_url, function(data) { var […]