the_oliver Posted February 3, 2007 Share Posted February 3, 2007 Hello, I have a single six didget number srored in a table. Is there a way that i can make it automaticaly incriment by one ever day at midnight? Thanks! Link to comment https://forums.phpfreaks.com/topic/36922-making-a-number-incriment-daily/ Share on other sites More sharing options...
effigy Posted February 3, 2007 Share Posted February 3, 2007 Yes, use cron (see signature). Link to comment https://forums.phpfreaks.com/topic/36922-making-a-number-incriment-daily/#findComment-176286 Share on other sites More sharing options...
the_oliver Posted February 3, 2007 Author Share Posted February 3, 2007 sure, but i was wondering if there is a way to do it direct from postgres? Link to comment https://forums.phpfreaks.com/topic/36922-making-a-number-incriment-daily/#findComment-176290 Share on other sites More sharing options...
btherl Posted February 5, 2007 Share Posted February 5, 2007 I don't think there is.. postgresql is just a database, not a scheduling system Link to comment https://forums.phpfreaks.com/topic/36922-making-a-number-incriment-daily/#findComment-177136 Share on other sites More sharing options...
artacus Posted February 9, 2007 Share Posted February 9, 2007 Here are some things you can do: (easiest first) 1) Have a calendar table with every day and its corresponding number. 2) Don't store it in the db at all. Calculate it based on the number of days since a base date. So say '2006-01-01' was day 600,000. You'd calculate the number of days since then and add it to 600,000. Link to comment https://forums.phpfreaks.com/topic/36922-making-a-number-incriment-daily/#findComment-180394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.