Hi everyone,
I have the following code where I'm trying to append extra parts to a 'where' clause depending on the conditions below:
$where = " WHERE item_to_subcat.subcatID='$subcatID'";
if (isset ($_GET['itemTypeID'])) {
$itemTypeID = mysqli_real_escape_string($link, $_GET['itemTypeID']);
$where = $where . " AND itemTypes.itemTypeID='$itemTypeID'";
}
else (isset ($_GET['itemSubtypeID'])) {
$itemSubtypeID = mysqli_real_escape_string($link, $_GET['itemSubtypeID']);
$where = $where . " AND itemSubTypes.itemSubtypeID='$itemSubtypeID'";
}
There's more to the select query but this is the section where the error is occurring. On testing I get the following parse error:
Parse error: syntax error, unexpected '{' in /Applications/MAMP/htdocs/site/catalogue/corporate/index.php on line 50
Line 50 is:
else (isset ($_GET['itemSubtypeID'])) {
I'm pretty sure I've nested the code incorrectly but I can't work out where it's wrong.
Can anyone see where the error is?
Appreciate any help.