title: Set selected drop down and then get value on "$_GET['user_level']" PHP
body: <p>I have a dropdown on my site which is static, but the value is different for each user. I'm wanting to have it so that it has a selected value based on the user level, but if I change my selection and press save it will update that value in the table. However every time It's just setting the value to 0.</p>
  
  <p>Select code so far:</p>
  
  <pre><code>&lt;select id="user_level&lt;?php echo $rrows['id']; ?&gt;" name="user_level&lt;?php echo $rlurows['id']; ?&gt;"&gt;
      &lt;option value="5"&lt;?php if($rlurows['user_level'] == 5){ echo " selected=\"selected\"";} ?&gt;&gt;Admin&lt;/option&gt;
      &lt;option value="4"&lt;?php if($rlurows['user_level'] == 4){ echo " selected=\"selected\"";} ?&gt;&gt;Staff&lt;/option&gt;
      &lt;option value="3"&lt;?php if($rlurows['user_level'] == 3){ echo " selected=\"selected\"";} ?&gt;&gt;Lead&lt;/option&gt;
      &lt;option value="2"&lt;?php if($rlurows['user_level'] == 2){ echo " selected=\"selected\"";} ?&gt;&gt;Guard&lt;/option&gt;
      &lt;option value="1"&lt;?php if($rlurows['user_level'] == 1){ echo " selected=\"selected\"";} ?&gt;&gt;Camp&lt;/option&gt;
      &lt;option value="0"&lt;?php if($rlurows['user_level'] == 0){ echo " selected=\"selected\"";} ?&gt;&gt;Guest&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>On Save Code:</p>
  
  <pre><code>onclick='$.get("do.php",{ cmd: "edit", user_level:$("input#user_level&lt;?php echo $rlurows['id']; ?&gt;").val(),id: "&lt;?php echo $rlurows['id']; ?&gt;" } ,function(data){ $("#msg&lt;?php echo $rlurows['id']; ?&gt;").html(data); });'
  </code></pre>
  
  <p>Code retrieving in do.php:</p>
  
  <pre><code>$lvl = mysql_real_escape_string($_GET['user_level']);
  </code></pre>
  
  <p>Can anyone see the issue that is making my code not work? Do I need to post any more code?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Whoops. Must be tired. :). <code>&lt;select id="user_level&lt;?php echo $rrows['id']; ?&gt;</code> should be <code>&lt;select id="user_level&lt;?php echo $rlurows['id']; ?&gt;</code> and <code>input#user_level</code> should be <code>select#user_level</code></p>