Welcome Guest, Not a member yet? Register   Sign In
Ad expiration, How?
#11

[eluser]Dam1an[/eluser]
@techneke, out of curiosity, is there any reason why you would choose to use an enum with just 2 values over a boolean?
#12

[eluser]Zack Kitzmiller[/eluser]
[quote author="Dam1an" date="1245720223"]@techneke, out of curiosity, is there any reason why you would choose to use an enum with just 2 values over a boolean?[/quote]

Yes. There was a time, when I used a boolean on a project, because I had something, that was either active, or inactive, like I mentioned earlier.. But then the client threw me a curve ball and wanted it to have 3 states, 'active', 'inactive', and 'pending'.

I spent a bunch of time figuring out how to do that with best practice in mind and came up with that little convention. I realize it's not always necessary, and booleans will usually work, but I like to plan ahead as much as possible.
#13

[eluser]Dam1an[/eluser]
That make sense, can always rely on client to come up with the unexpected lol
#14

[eluser]louis w[/eluser]
I also suggest simply adding a unix timestamp of when the ad was created in a datetime field, then just select against it with your query.

$this->db->where("date_create > DATE_SUB(Current_Date(), INTERVAL 30 DAY)");




Theme © iAndrew 2016 - Forum software by © MyBB