title: Trying to get property of non-object in
body: <p>on Control page:</p>
  
  <pre><code>&lt;?php
    include 'pages/db.php'; 
    $results = mysql_query("SELECT * FROM sidemenu WHERE `menu_id`='".$menu."' ORDER BY `id` ASC LIMIT 1", $con);
    $sidemenus = mysql_fetch_object($results);
  ?&gt;
  </code></pre>
  
  <p>on View Page:</p>
  
  <pre><code>&lt;?php foreach ($sidemenus as $sidemenu): ?&gt;
    &lt;?php echo $sidemenu-&gt;mname."&lt;br /&gt;";?&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>Error is:</p>
  
  <blockquote>
    <p>Notice: Trying to get property of non-object in C:\wamp\www\phone\pages\init.php on line 22</p>
  </blockquote>
  
  <p>Can you fix it? I don't have any idea what happened.</p>