key Posted July 27, 2008 Share Posted July 27, 2008 I keep get this error how do i fix it//gather the topics $get_topics_sql = "SELECT topic_id, topic_title, DATE_FORMAT(topic_create_time, '%b %e %Y at %r') AS fmt_topic_create_time, topic_owner FROM forum_topics ORDER BY topic_create_time DESC"; ::::::on this line of code $get_topic_res = mysql_query($mysql, $get_topic_sql) or die(mysql_error($mysql)); if (mysqli_num_rows($get_topic_res) < 1) { //there are no topics, so say so $display_block = "<p><em>No topics exist.</em></p>"; } else { //create the display string $display_block = " <table cellpadding=\"3\" cellspacing=\"1\" border=\"1\"> <tr> <th>TOPIC TITLE</th> <th># of POSTS</th> </tr>"; Quote Link to comment https://forums.phpfreaks.com/topic/116906-i-need-help-with-my-code/ Share on other sites More sharing options...
trq Posted July 27, 2008 Share Posted July 27, 2008 And the error is ? Quote Link to comment https://forums.phpfreaks.com/topic/116906-i-need-help-with-my-code/#findComment-601181 Share on other sites More sharing options...
.josh Posted July 28, 2008 Share Posted July 28, 2008 $get_topic_res = mysql_query($mysql, $get_topics_sql) or die(mysql_error($mysql)); You need to reverse the variables in your mysql_query argument. The argument should be querystring, connection $get_topic_res = mysql_query($get_topics_sql, $mysql) or die(mysql_error($mysql)); You also forgot the "s" in "topic". But that may not fix the problem. It for sure needs to be that way, but that may or may not be your only problem. If it still doesn't work (don't change it back), post the error. Quote Link to comment https://forums.phpfreaks.com/topic/116906-i-need-help-with-my-code/#findComment-601291 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.