Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts

    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

  • #2
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    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

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    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 :)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •