Image

Imagemikebeltx wrote in Imagephp

weird session issue

I'm sure somebody might respond with "RTFM," but I'm genuinely perplexed by this.
For argument's sake, let's say that a session variable is set inside a login page, like so:
<?
    session_start();
    $_SESSION['staff_id'] = "3";
    $_SESSION['staff_firstname'] = "mike";
?>


Later, in another page, I might be getting a listing of all staff members, like so:
<?
    $query = "SELECT * FROM staff";
    $result = mysql_query($query);
    while ( $row = mysql_fetch_array($result)){
        $staff_id = $row['staff_id'];
        $staff_firstname = $row['staff_firstname'];
    }
?>


When this happens, $_SESSION['staff_id'] gets overwritten with regular old $staff_id. What the !@#$? Is this a register_globals issue?