Re: Modulo Arithmetic... for negative numbers

2004-08-19 Thread Richard Dyce
Thanks Keith! About 5 minutes after I posted it, I had a personal email from someone suggesting exactly(!) the same thing. For the record, my reply: On 19 Aug 2004, at 21:39, Richard Dyce wrote: Thanks! I'd got to go with: if(weekday(d)<4,3-weekday(d),10-weekday(d)) day) which is I

Modulo Arithmetic... for negative numbers

2004-08-19 Thread Richard Dyce
Hi, just an odd query. Background: I'm trying to calculate the Next Thursday and Next Friday dates from today (whenever that is), and return today's date if it's already a Thursday or a Friday. As a bit of a traditionalist, I've been used to modulo arithmetic always giving a positive answer, so

Re: Re[2]: Enum default values

2004-01-05 Thread Richard Dyce
Ah ha! Thank you Aleksandar. That's a much better solution. In fact, now youv'e told me this, I looked in the Manual, and the scales where lifted from my eyes. You've saved me re-writing (and re-thinking) a large chunk of PHP. For anyone else's future reference it's all there in plain english

Re: Enum default values

2004-01-05 Thread Richard Dyce
Jay! Thanks for help with a 'proper' insert. ;-) Yes, the full statement works fine. (I assume this is something like the not setting default values from importing DATA files?) All a bit of a shame, as I'm executing the insert from a PHP script, and was trying to make the routine as generic as

Enum default values

2004-01-05 Thread Richard Dyce
Hi, I'm having problems with setting default values for an enum. It's for a booking system, and I'm keeping track of which day a property starts a booking period. It's useful to have the enum in day order therefore. Omitting the prompts, here's what's happening; * drop table property; c