Jump to content

[SOLVED] why isn't this working?


almightyegg

Recommended Posts

I can't see where I've gone wrong :-[

 

<?
$GET = $id;
$one = mysql_query("SELECT * FROM forums WHERE id = '$GET'");
$forum = mysql_fetch_array($one);
$two = mysql_query("SELECT * FROM topics WHERE fid = '$GET' AND pinned = '1'");
$three = mysql_query("SELECT * FROM topics WHERE fid = '$GET' AND pinned = '0'");
$mem = mysql_fetch_array($sql);

?>

<table border="0"><tr>
<td width="180"><b>Topic</b></td><td width="120"><b>Posted By</b></tD><td width="50"><b>Replies</b></td></tr>
<?

while($topic = mysql_fetch_array($two)){
$blah = mysql_query("SELECT * FROM replies WHERE fid='{$topic[id]}'") OR die(mysql_error());
$bla = mysql_num_rows($blah);

echo "<tr><td><a href='http://forum.koggdesigns.co.uk/topic.php?id=$topic[id]'>$topic[title]</a></td><td><a href='http://members.koggdesigns.co.uk/member.php?id=$topic[userid]'>$topic[username]</td><td>$bla</td></tr><br>";
}
while($topic2 = mysql_fetch_array($three)){
$blah2 = mysql_query("SELECT * FROM replies WHERE fid='{$topic2[id]}'") OR die(mysql_error());
$bla2 = mysql_num_rows($blah2);

echo "<tr><td><a href='http://forum.koggdesigns.co.uk/topic.php?id=$topic2[id]'>$topic2[title]</a></td><td><a href='http://members.koggdesigns.co.uk/member.php?id=$topic2[userid]'>$topic2[username]</td><td>$bla2</td></tr><br>";
}
?>

I've added two posts too, 1 that is pinned one that isn't, yet neither of them show. It just says unknown column 'fid' in 'where clause' yet i'm looking at phpmyadmin right now and it IS there

Link to comment
https://forums.phpfreaks.com/topic/38086-solved-why-isnt-this-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.