Jump to content

Recommended Posts

I'm trying to match a few things here and I'm getting a little confused - any help would be appreciated:

 

$s = "SELECT DISTINCT DEVID, INPUTDEVID, MACHINE FROM EVENTS WHERE (EVENT_TIME_UTC BETWEEN '".$start."' AND '".$end."') AND ((EVENTTYPE = 0 AND EVENTID = 0) OR (EVENTTYPE = 4 AND EVENTID IN (2,8,10,53,413,431))) AND (MACHINE = ".$machine.")";

 

So I'm trying to find any event that has an eventtype of 0 AND an eventid of 0... OR any eventtype of 4 and eventid in (2,8,10,53,413,431).  I do NOT want an eventtype of 4 and an eventid of 0.  I'm getting a bit confused on how to convey this in the sql statement.  I thought I could separate it with parentheses and that would do the trick, but I'm not so sure

 

Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/201435-matching-criterion/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.