Bird at my window






Bird at my window
The place I live is not a very quiet one. A typical populated area in the city with people screaming, street dogs barking, hawkers shouting everywhere. The place is always lively.
Among all these chaos, I found this little baby bird sitting quiet on the mango tree right beside my window.

1 Comment

Mysql rounding for currency format






Most of the time we are used to format float numbers into currency format by PHP (or any front end language) using functions like fprintf(). If we could grab the result formatted from the db, we won’t need to use front end formatting. Mysql function format() is the function we need. Lets say we have […]

,

4 Comments

Build dropdown from Mysql SET or ENUM fields






We need to populate dropdown fields from Mysql SET or ENUM fields pretty often. So here is how I use to do it. Lets say ‘test’ is a table that has a field, ‘agree’ of type ‘SET’ having values ‘Yes’ and ‘No’. On the front end of my application I want to show a dropdown/select […]

,

12 Comments

Javascript – Ajax file upload using Yahoo API






Web user interfaces have been very dynamic after the introduction of AJAX. People are now more used to with pages that do not refresh on every click. For developers it has been a challenge to build sites that are more user friendly and to achieve that file upload without refreshing the page is a big […]

,

9 Comments

Show pound sign in input field by Javascript






If you have ever tried to put pound sign (or any special character) in any input fields by Javascript, you know that it is not that straight forward. If we write code like this, document.getElementById(‘input_field_id’).value = ‘£1000′; It’ll display some question mark(unrecognized character) instead of the pound sign. So we need to put character’s unicode […]

,

8 Comments

Javascript – Round numbers to some decimal places






Javascript’s Math.round function allows a user to round a float to an integer. But most of the time we need some function that’ll let us round the number to any decimal places we want. So here is the function that’ll solve your problem: function roundNumber(num,decimal){ var numerator = Math.round(num * Math.pow(10, decimal)); var denominator = […]

,

No Comments

Javascript Beginners – Select a dropdown option by value






A very simple and common issue a Javascript newbie often faces is how to select a dropdown option dynamically by value. People who are working for long with Javascript would solve it in minutes, but hey, this is for a newbie, remember? So this is a simple function I wrote to do the work. function […]

, ,

20 Comments

Mysql function to find distance between two places using lat/long






Sometimes we need to find out list of places that are within a certain radius from a center place where coordinates of the places are saved in the database. Now we have 2 solutions for this – either loop through all the places find the distance from the center point and keep the places that […]

,

33 Comments

Use multiple database connections in Zencart






There are times when you may need to grab data from a database outside the Zencart database, it may be the case when two zencart installation need to share data or may be some other reasons. To achieve this, you need to open 2 database connections that wont overlap each others. People generally open the […]

, ,

12 Comments

Google Geocoding Service – get latitude, longitude from address, postcode






Google has a very handy web service available for geocoding. Very often we require to know the longitude, latitude of a postcode, may be for finding distance between 2 places or any other reasons (who cares) and as always, Google is ready with the service before you realize you’ll need that :-). This is the […]

,

61 Comments