title: Variable not found error
body: <p>Hey, can anyone notice any errors in this code:</p>
  
  <pre><code>&lt;?php
  include("config.php");
  if(isSet($_POST['lastmsg']))
  {
    $lastmsg = $_POST['lastmsg'];
    $lastmsg = mysql_real_escape_string($lastmsg);
    $result  = mysql_query("SELECT * 
                              FROM updates 
                             WHERE update_time &lt; '$lastmsg' 
                          ORDER BY msg_id DESC
                             LIMIT 9");
    while($row=mysql_fetch_array($result))
    {
      $msg_id  = $row['update_time'];
      $message = $row['item_content'];
    ?&gt;
     &lt;li&gt;
       &lt;?php echo $message; ?&gt;
     &lt;/li&gt;
    &lt;?php
    }
    ?&gt;
  
    //More Button here $msg_id values is a last message id value.
    &lt;div id="more&lt;?php echo $msg_id; ?&gt;" class="morebox"&gt;
    &lt;a href="#" id="&lt;?php echo $msg_id; ?&gt;" class="more"&gt;more&lt;/a&gt;
    &lt;/div&gt;
    &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>Notice: Undefined variable: msg_id in C:\wamp\www\stream_scripts\draft2\ajax_more.php on line 20 Call Stack #TimeMemoryFunctionLocation 10.0012373824{main}( )..\ajax_more.php:0 " class="morebox"&gt; ( ! ) Notice: Undefined variable: msg_id in C:\wamp\www\stream_scripts\draft2\ajax_more.php on line 21 Call Stack #TimeMemoryFunctionLocation 10.0012373824{main}( )..\ajax_more.php:0 " class="more"&gt;more
  </code></pre>
  
  <p>Anyone can see anything wrong please comment. Thanks! :)</p>