Re: [PHP-DB] generating sequence without AUTO_INCREMENT

2003-06-27 Thread Lester Caine
Doing what I wanted to do took six hours and 120 lines of code, all in all, but I learnt a good deal on the way. ;-) At times, manual intervention can be a lifesaver. You have already said that you have to 'ring fence' bank holidays, and weekends, so someone has to check or enter the bank

Re: [PHP-DB] generating sequence without AUTO_INCREMENT

2003-06-26 Thread Doug Thompson
Maybe it's because I'm not fully awake yet that the problem seems less complex than it is. What is wrong with using a seperate table for each year? Doug On Thu, 26 Jun 2003 08:43:17 +0200, anders thoresson wrote: Hi, I'm working on a web based article planning system for a news paper, based

RE: [PHP-DB] generating sequence without AUTO_INCREMENT

2003-06-26 Thread Jennifer Goodie
You could you do MAX(issue_number)+1 where YEAR(date) = Year(NOW()) to get next issue number for the current year, but if you had 2 people entering issues at the same time, it wouldn't work so well. Just trying to give you a starting point because it seems like you haven't really gotten an answer

Re: [PHP-DB] generating sequence without AUTO_INCREMENT

2003-06-26 Thread anders thoresson
MAX(issue_number)+1 where YEAR(date) = Year(NOW()) I continued to work while waiting for ideas, and have now manage to get a script that work. I'm getting the next issue number this way: // Connect to database to get latest issue number from table un_issue db_connect($dbuser,