Search the Community
Showing results for tags 'call to a member function'.
-
Hi am in need of abit of help from anyone,am having a problem with my latest topics file,I have an error that i can't seem to sort out. Fatal error: Call to a member function fetch_array() on a non-object in C:\wamp\www\\templates\atest_topics.php on line 5 Here is my code thanks in advance. <div class="nav_box"><div class="nav">Latest Topics</div> <div class="nav_box2"> <?php $query = yasDB_select("SELECT forumtopics.subjest,forumtopics.date,forumtopics.name,user.id,user.username,user.avatarfile.user.useavatar FROM forumtopics LEFT JOIN user ON forumtopic.name = user.username ORDER BY forumtopics.id DESC LIMIT 5"); while($row = $query->fetch_array(MYSQLI_ASSOC)){ $id = $row['id']; $subject = $row['subject']; $date = date("m-j-y G:i"); $username = $row['name']; if ($setting['seo'] == 'yes'){ $topiclink = $setting['siteurl'].'forumtopics/'.$id.'/1.html'; } else { $topiclink = $setting['siteurl'].'index.php?act=forumtopics&id='.$id; } if ($row['useavatar'] == '1') { $avatarimage = $setting['siteurl'].''.$row['avatarfile']; } else { $avatarimage = $setting['siteurl'].'useruploads/noavatar.JPG'; } if ($setting['seo'] == 'yes') { $memberlink = $setting['siteurl'].'showmember/'.$id.'.html'; } else { $memberlink = $setting['siteurl'].'index.php?act=showmember&id='.$id; } ?> <a href="<?php echo $memberlink;?>"><img src="<?php echo $avatarimage;?>" width="40" height="40" align="center" title="<?php echo $username;?>"></a> <a href="<?php echo $topiclink;?>"><?php echo $subject;?></a> - <?php echo $date;?><br> <?php } $query->close(); ?> </div> </div>