Jump to content

Recommended Posts

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>";

Link to comment
https://forums.phpfreaks.com/topic/116906-i-need-help-with-my-code/
Share on other sites

$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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.