SELECT within range or set active = 0 if out of range
Moderator: General Moderators
SELECT within range or set active = 0 if out of range
We're setting up a job listing application (ReverandDexter & I). In the application you can set when your listing should expire. Does it make more sense to SET active = 0 if expiration date > NOW() or does it make more sense to just add a WHERE expire_date < NOW() to all of my select queries?
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- ReverendDexter
- Forum Contributor
- Posts: 193
- Joined: Tue May 29, 2007 1:26 pm
- Location: Chico, CA
For a little more insight into the debate, I'm a staunch advocate of the "setting active = 0" strategy. Using that, a user will never run into the situation where their job post is "active", but not displaying. Also, it makes it very easy for a user to get their job back on the board (just reactivate it) when it comes off (if they so choose to relist).
I agree that the where clause method is much faster, I just don't agree that it's *better*.
I agree that the where clause method is much faster, I just don't agree that it's *better*.