[SOLVED] Syntax problem, can't find it
Posted: Tue Jul 06, 2004 10:26 am
This code checks variables and assigns something to $where based on whether the variables are set.
It should check all the variables, and if they are all empty, then it should leave $where empty, else it should assign it to "WHERE" (SQL select statment is based on this)
The above is leaving $where empty regardless of whether the other variables are assigned or not.
Help, this should work as far as I can see.
Cheers all
LinkJames
*Edit* Meant to say, where I have echoed the variables out, I get a blank line or the variables, so I know they are getting assigned, or left empty as they should be
It should check all the variables, and if they are all empty, then it should leave $where empty, else it should assign it to "WHERE" (SQL select statment is based on this)
Code: Select all
echo $where, $testset, $testsetand, $suiteset, $suitesetand, $groupset, $groupsetand, $productset, $productsetand, $statusset, $statussetand, $ownerset;
echo "<br>";
if ((!isset($testset)) && (!isset($testsetand)) && (!isset($suiteset)) && (!isset($suitesetand)) && (!isset($groupset)) && (!isset($groupsetand)) && (!isset($productset)) && (!isset($productsetand)) && (!isset($statusset)) && (!isset($statussetand)) && (!isset($ownerset)))
{
$where = "WHERE";
echo "Set Where";
echo "<br>";
}
else
{
$where = "";
echo "no where";
echo "<br>";
}Help, this should work as far as I can see.
Cheers all
LinkJames
*Edit* Meant to say, where I have echoed the variables out, I get a blank line or the variables, so I know they are getting assigned, or left empty as they should be