Archive for May, 2010

Group by Date when Stored in Mysql DataBase as Date Time

I have a table called date_count with 2 columns one is a value and another is a date time, say called date_time in mysql. Date Time in mysql is stored as dd-mm-yy hh:mm:ss. The issue comes when I need to get the number of rows per day. As its stored as date time format in mysql , you need to specify both date and time when you specify a group by. So grouping by day is not possible in that case. So we need to use the in-build mysql function DATE(). The function accepts date time as parameter and returns only date back. So we just need to use the DATE() function where we need to group by date and all the date time values are converted to date and can be grouped by date. So here is the implementation of it.

Continue reading “Group by Date when Stored in Mysql DataBase as Date Time” »

, , , , , , ,


Pass cookie from script to firefox

I had a requirement to get firefox to open a logged in page in firefox. I used it for automated opening of some logged in pages. But there is another use for it. It can be used for opening mail or any other site that needs to be logged in. The only issue, this method works on sites that relies on cookies only. This is fine as almost all websites run using cookies. So what the script does is, it has the username and passwords. It logs into your account and gets the cookie and passes the cookie to your browser. So when we open the page again in browser it already has valid cookie and there is no need to login. You will go thought to the logged in page and thats it. You just need to run the script and you can make the script to take any number of sites. Currently I have configured only to automate for Yahoo! . It can be easily extended to add any more sites.

Continue reading “Pass cookie from script to firefox” »

, , , , , , , , ,