howdy,
i have a page which gets inlcuded into certain pages on the site.. on the included page it does a query to a db then gets a value this part works fine. It then should check that value it gets from the db against some names do prceed aquardingly b ut for some reason it's defaulting to the 1st if statment despite the value gotten from the db
see code below...
<?
//get company from db
$res = mysql_query("SELECT company FROM users WHERE uname='$_SESSION[uname]'");
$num = mysql_numrows($res) ;
if ($num == 1) {
$company = mysql_result($res, 0, 'company');
echo $company;
}
//check to see if the company is one of these
if ($company='Company1') {
$company = "company1";
}
elseif ($company='Company2') {
$company = "company2";
}
// if not then default to this one
else {
$company = "default";
}
?>