Fatal error: Call to a member function execute() on a non-object php
<p>How to fix this code I don't know problem come from where ?</p>

<pre><code>        $results = $mysqli-&gt;prepare("SELECT id, title, tags,thumb,views,duration,date,owner FROM `videos` ORDER BY id DESC LIMIT $position, $items_per_group");
        $results-&gt;execute(); //Execute prepared Query
        $results-&gt;bind_result($id_r, $title_r, $tags_r,$thumb_r,$views_r,$duration_r,$date_r,$owner_r); //bind variables to prepared statement
        while($results-&gt;fetch()){ //fetch values
        $resultsa = $mysqli-&gt;prepare("SELECT id,user FROM `users` where `owner`='$owner_r'");
        $resultsa-&gt;execute(); //Execute prepared Query
        $resultsa-&gt;bind_result($f,$user_getbyid); //bind variables to prepared statement
        $resultsa-&gt;fetch();
    ?&gt;
    &lt;a href="video/&lt;?php echo $id_r; ?&gt;"&gt;
    &lt;div class="video"&gt;
    &lt;div class="img"&gt;&lt;img src="&lt;?php echo $thumb_r; ?&gt;"/&gt;&lt;/div&gt;
    &lt;div class="title"&gt;&lt;h2&gt;&lt;?php echo htmlspecialchars_decode($title_r); ?&gt;&lt;/h2&gt;&lt;/div&gt;
    &lt;div class="pub_by"&gt;&lt;span id="pub_by_user"&gt;Published by : &lt;a href="user/"&gt;&lt;?php echo $user_getbyid; ?&gt;&lt;/a&gt;&lt;/span&gt;&lt;span id="pub_time"&gt;&lt;?php echo htmlspecialchars_decode($date_r); ?&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;div class="time"&gt;&lt;?php echo $duration_r; ?&gt;&lt;/div&gt;
    &lt;div class="info"&gt;
    &lt;ul&gt;
    &lt;li&gt;&lt;?php echo $views_r; ?&gt;&lt;/li&gt;
    &lt;li&gt;148&lt;/li&gt;
    &lt;li&gt;45&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/div&gt;
    &lt;/div&gt;
    &lt;/a&gt;
    &lt;?php
    }
        $mysqli-&gt;close();
    }
?&gt;
</code></pre>

<p>Please fix this code and explain me why it not work like that</p>