mike12255 Posted February 17, 2009 Share Posted February 17, 2009 I got the following bit of code: <td height="29" colspan="20" background="images/index_35.gif"><a href="math.php">Math Questions: <?php $info = $_GET['id']; $nquery = "SELECT * FROM forumtutorial_posts WHERE postid = $info AND area = 'math'"; echo mysql_query($nquery); ?></a></td> and it outputs the following: Math Questions: Resource id #15 were it should output: Math Questions:test Quote Link to comment https://forums.phpfreaks.com/topic/145502-solved-whats-up-with-the-return-of-this-query/ Share on other sites More sharing options...
premiso Posted February 17, 2009 Share Posted February 17, 2009 mysql_fetch_assoc You have to retrieve the rows from the resource. Quote Link to comment https://forums.phpfreaks.com/topic/145502-solved-whats-up-with-the-return-of-this-query/#findComment-763906 Share on other sites More sharing options...
mike12255 Posted February 17, 2009 Author Share Posted February 17, 2009 o, i read that (thanks) and came up with this: $info = $_GET['id']; $nquery = "SELECT * FROM forumtutorial_posts WHERE postid = $info AND area = 'math'"; $result = mysql_query(nquery); while ($row = mysql_fetch_assoc($result)) { echo $row['title']; } and im getting this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/schoolw1/public_html/message.php on line 136 that line is while ($row = mysql_fetch_assoc($result)) { but im not sure what my error is. Quote Link to comment https://forums.phpfreaks.com/topic/145502-solved-whats-up-with-the-return-of-this-query/#findComment-763910 Share on other sites More sharing options...
premiso Posted February 17, 2009 Share Posted February 17, 2009 mysql_query(nquery); nquery should be $nquery Quote Link to comment https://forums.phpfreaks.com/topic/145502-solved-whats-up-with-the-return-of-this-query/#findComment-763912 Share on other sites More sharing options...
mike12255 Posted February 17, 2009 Author Share Posted February 17, 2009 curse my bad vision, cant beleive i missed that, thanks. Going to get my glasses right away. Quote Link to comment https://forums.phpfreaks.com/topic/145502-solved-whats-up-with-the-return-of-this-query/#findComment-763915 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.