elseif misfiring
Posted: Fri Jul 02, 2010 5:03 pm
I'm another noob that hacked together some code and it stopped working
All my other conditionals were working until I got to this one.
This factor ($searoffice == "NULL") is being ignored i.e. the page is running the $sql6 function when $searoffice is not NULL.
Does anything jump out as being wrong? When I echo $searoffice it shows correctly. Thanks.
All my other conditionals were working until I got to this one.
This factor ($searoffice == "NULL") is being ignored i.e. the page is running the $sql6 function when $searoffice is not NULL.
Does anything jump out as being wrong? When I echo $searoffice it shows correctly. Thanks.
Code: Select all
elseif (($searoffice == "NULL") && ($searcounty != "*") && ($searcounty != "NULL") && ($seartrans == "NULL"))
{
$sql6= "
select countyname, count(orderkey) AS Expr1
from tblorder
where countyname = '$searcounty'
AND (OrderDateTime between '$searstdate' AND '$searenddate')
group by countyname";
$result = odbc_exec($sqlconnect, $sql6);
while ($row = odbc_fetch_array($result)) {
echo $row["countyname"], "\n";
echo $row["Expr1"], "<br>";
}
}
elseif (($searoffice != "NULL") && ($searoffice != "*") && ($searcounty != "*") && ($searcounty != "NULL") && ($seartrans == "NULL"))
{
$sql7= "
select titleunitname, tblorder.countyname, count(orderkey) AS Expr1
from tblorder
inner join qrytitleunits on tblorder.titleunitnum = qrytitleunits.titleunitnum
where tblorder.countyname = '$searcounty'
AND titleunitname = '$searoffice'
AND (OrderDateTime between '$searstdate' AND '$searenddate')
group by titleunitname,tblorder.countyname";
$result = odbc_exec($sqlconnect, $sql7);
while ($row = odbc_fetch_array($result)) {
echo $row["titleunitname"], "\n";
echo $row["countyname"], "\n";
echo $row["Expr1"], "<br>";
}
}