Using ifelse to go to another page
| From: | Alex Francis | Date: | Sat, 04 Jan 2003 13:55:52 +0000 |
| Subject: | Using ifelse to go to another page | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24544@lists.php.net to get a copy of this message | ||
I have dropdown lists on one page which were working fine. However I need to
make a slight alteration and add another 2 ifelse statements to go to
another page instead of carrying out the $SQL statement.
I have added the last 2 ifelse statements but I still get the SELECT
statement working. Can someone help please.
<?
if ($level=="All Levels")
{
$SQL = "SELECT * FROM courses where department='$department'";
}
elseif ($level!="All Levels")
{
$SQL = "SELECT * FROM courses where department='$department' and
level='$level'";
}
elseif ($department=="5-14 Curriculum")
{
"<A HREF 'add_5-14_material.php'></A>";
}
elseif ($level=="5-14 Curriculum")
{
"<A HREF 'add_5-14_material.php'></A>";
}
$retid = mysql_db_query($dbname, $SQL, $link);
if (!$retid) { echo( mysql_error()); }
else {
// the rest creates a table with the information from the SELECT statement.