Jump to content

[SOLVED] whats wrong with my query??


mike12255

Recommended Posts

I got the following table:

 

$page = $_GET['page'] * 10;
$tolimit = 10;
print "<table class='maintable'>";
print "<tr class='headline' color = 'white'><td width=20%>Author</td><td width=80%>Post</td></tr>";
$gettopic="SELECT * from forumtutorial_posts where postid='$id' AND area ='math' LIMIT $page $tolimit";

$gettopic2=mysql_query($gettopic) or die("Could not get topic");
$gettopic3=mysql_fetch_array($gettopic2);
print "<tr class='mainrow'><td valign='top'>$gettopic3[author]</td><td vakign='top'>Last replied to at $gettopic3[showtime]<br><hr>";
//print  "<A href='deletetopic.php?id=$id'><img src='images/edit-btn.gif'  height='25'align='right'</a> ";
$message=strip_tags($gettopic3['post']);
$message=nl2br($message);
print "$message<hr><br>";
if ($record['locked'] < 1 || ($session->isAdmin())){
print "<a href= 'reply.php?id=$id' ><img src='images/quote-btn.gif'  height='25' align='right'></a>";
}
print "</td></tr>";
$getreplies="Select * from forumtutorial_posts where parentid='$id' order by postid ASC"; //getting replies
$getreplies2=mysql_query($getreplies) or die("Could not get replies");
while($getreplies3=mysql_fetch_array($getreplies2))
{
   print "<tr class='mainrow'><td valign='top'>$getreplies3[author]</td><td vakign='top'>Last replied to at $getreplies3[showtime]<br><hr>";
   $message=strip_tags($getreplies3['post']);
   $message=nl2br($message);


   print "$message<hr><br>";

if ($record['locked'] < 1 || ($session->isAdmin())){
print "<a href= 'reply.php?id=$id' ><img src='images/quote-btn.gif'  height='25' align='right'></a>";
}

}

   //print "</td></tr>";

print "</table>";

 

The Im getting the error that the following line is told to give:

 

$gettopic2=mysql_query($gettopic) or die("Could not get topic");

 

The URL is

 

 

I dont know what is wrong with my query when i change "id" to 22 and do sql in phpmyadmin it works.

Link to comment
Share on other sites

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.