HEADER If/ELSE STATEMENTS

Hi There,

I am having trouble with my if/then elseif/then statements. The code below if on all of my pages as a header, and what it does is shows the user their header based on who they are. The info is being processed from a row in the database table called “is_admin”. What I want to happen is that if you are a 0(basic user) you will see “header.php”. 1(admin) you will see “header_admin.php”, and 2(client) see the client_header.php.

The code just isn’t working right. It is showing the admin user as a 0, and the basic user as a 1. I don’t know what to do. Any suggestions?!?!

$is_admin = false;
 
$sql = "SELECT is_admin FROM users WHERE username='".$usernamelog."' and password='".$passwordlog."' LIMIT 1";
$checkquery = mysql_query( $sql );
$data = mysql_fetch_array( $checkquery );

if ( $data['is_admin'] == 0 ) {
include_once('header.php');
}
else if ( $data['is_admin'] == 1) {
include_once('header_admin.php');
} 
else if ( $data['is_admin'] == 2) {
include_once('client_header.php');
}