About PHP selectbox
<p>I have a question about a select box, I have a select box on the client side account.php with a list of States/Provinces and I already have other fields like address, name, email and etc.</p>

<p>I have a col in a database called state thats where user state info stores when I press update account, everything updates perfectly, but I wanna make sure my select box stays selected to whenever a user click on the update button and when they logback in it would stays selected when i choose my state now and update, it will update in the db but on the page when i logback in it goes to the first option box</p>

<p>Any simple example i could have that would be great!</p>

<pre><code>&lt;?php public function getUserData() { 
    global $db, $core; 
    $sql = "SELECT *, DATE_FORMAT(created, '%a. %d, %M %Y') AS cdate," . "\n DATE_FORMAT(lastlogin, '%a. %d, %M %Y') AS ldate" . "\n FROM " . $this-&gt;uTable . "\n 
            WHERE id = '" . $this-&gt;uid . "'"; 
    $row = $db-&gt;first($sql); 
    return ($row) ? $row : 0; 
} ?&gt; 

&lt;?php $row = $user-&gt;getUserData(); ?&gt;
&lt;select name="state" id="state"&gt;
    &lt;?php $state = $row['state'];?&gt;
    &lt;option value="Ontario" &lt;?php if($state == "Ontario") echo "SELECTED" ?&gt;&gt;Ontario&lt;/option&gt;
    &lt;option value="Alberta" &lt;?php if($state == "Alberta") echo "SELECTED" ?&gt;&gt;Alberta&lt;/option&gt;
&lt;/select&gt;
</code></pre>
