Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-02-2010, 10:50 AM   PM User | #1
stfc_boy
Regular Coder

 
Join Date: Jun 2007
Posts: 310
Thanks: 86
Thanked 3 Times in 3 Posts
stfc_boy is an unknown quantity at this point
Not greater of equal to?

Hello,

I have a line of code which basically reads like so:

If the current date is inbetween a start and end date (using greater than and equal to) and live =2

Code:
if(time() >= strtotime(''.$row->starts.'') && time() <= strtotime(''.$row->ends.'') && ($row->live == 2))
But how would I make that a not statement ie If the current date is NOT inbetween a start and end date and live =2?

I just can't get it right in my head!

Thanks
stfc_boy is offline   Reply With Quote
Old 02-02-2010, 10:53 AM   PM User | #2
hinch
Regular Coder

 
hinch's Avatar
 
Join Date: Sep 2005
Location: UK
Posts: 921
Thanks: 25
Thanked 79 Times in 79 Posts
hinch is on a distinguished road
PHP Code:
if(time() < strtotime(''.$row->starts.'') && time() > strtotime(''.$row->ends.'') && ($row->live == 2)) 
__________________
A programmer is just a tool which converts caffeine into code

My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
My hobby: http://www.angel-computers.co.uk
My life: http://www.furious-angels.com
hinch is offline   Reply With Quote
Old 02-02-2010, 11:28 AM   PM User | #3
JAY6390
Regular Coder

 
Join Date: Dec 2009
Location: UK
Posts: 495
Thanks: 0
Thanked 58 Times in 58 Posts
JAY6390 is on a distinguished road
Note that you don't need the ''. and .'' either side of your times either
__________________
My site: JayGilford.com
Resources:
PHP Pagination Class | Getting all page links | Handling PHP Errors properly
If you like a users help, show your appreciation with the rep and thanks buttons :)
JAY6390 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:30 PM.


Advertisement
Log in to turn off these ads.