If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2015
    Member #
    3 times

    How i can add more condition to mysql query?

    id name status date
    1 ddd 1 2015-03-11
    2 dddd 1 2015-03-12
    3 dfdfgfg 0 2015-03-11
    4 ererre 1 2015-03-19
    5 eeeerer 0 2015-03-03

    Here is the table, - this is query I am adding to get the result. I want the result from the table where date should not be expired if the status is set to 1 and no condition if the status is zero. So it should display. So I made the query like this
    select * from sample where status='1' AND date>Now() OR status='0'
    I am getting the result as like this which is correct
    3 dfdfgfg 0 2015-03-11
    4 ererre 1 2015-03-19
    5 eeeerer 0 2015-03-03

    But I want to add more queries to the same, how i can add more condition to above query?


  3. #2
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Member #
    47 times

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 04:08 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: