php - SQL OR functioning like AND -


this relevant line of code:

$woquery = $dbc->prepare("select * workorder statusid <> 15 or statusid <> 12 order datein asc"); 

the problem having code, or function seems working , function.

if change (for example):

statusid <> 15 or statusid <> 15 

then correctly excludes records 15 statusid, same if set 12

if have single function no or, filters correctly. however, when have both, filters neither 12 or 15.

use not in 2 or operations

$woquery = $dbc->prepare("select * workorder statusid not in( 15, 12) order datein asc" 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -