Change the second ifelse-- either get rid of it, or put it at the end.

Right now your logic is like this:


if (a equals b) {
...
} elseif (a does not equal b) {
...
} elseif (c equals d)
etc


One of the first two conditions will always match, so the rest of the statement is skipped.

-bill

Alex Francis wrote:
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.






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to