Jump to content

[SOLVED] Number of Rows?


maxudaskin

Recommended Posts

<table style="border-top:1px #FFFFFF solid" width="774" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="21" height="20" align="center" valign="middle" bgcolor="#333355"> </td>
          <td width="279" height="20" align="center" valign="middle" bgcolor="#333355"><span class="style26">Subject</span></td>
          <td width="58" height="20" align="center" valign="middle" bgcolor="#333355"><span class="style26">Posts</span></td>
          <td width="213" height="20" align="center" valign="middle" bgcolor="#333355"><span class="style26">Last Post </span></td>
          </tr>
	  <?php
	  $forumsql = mysql_query("SELECT * FROM `forum_catagories` ORDER BY `forum_catagories`.`sort` ASC");
	  while($forum_row = mysql_fetch_array($forumsql)){
	  $forumid = $forum_row['cid'];
	  $postssql = mysql_query("SELECT forumid, postid, pid, name, date, time, topicid, type, title, text FROM forum_posts GROUP BY forumid WHERE forumid = '{$forumid}'");
	  while($posts = mysql_num_rows($post)){ // Line 269
          echo "<tr style=\"background-color:#EFF4FB;\" onMouseOver=\"this.style.backgroundColor='#E5EEF9';\" onMouseOut=\"this.style.backgroundColor='#EFF4FB';\">";
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid" height="30px">'.$forum_row1.'</td>';
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid">'.$forum_row['name'].'</td>';
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid">'.$forum_row1.'</td>';
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid">'.$forum_row1.'</td>';
          echo '</tr>';
	  }}
	  ?>
        </table>

 

Keeps giving me the error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.grable/vzoom/virtualzoom.net/comm/forum.php on line 269

Link to comment
Share on other sites

That was an issue, but it still isn't working...

 

<table style="border-top:1px #FFFFFF solid" width="774" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="21" height="20" align="center" valign="middle" bgcolor="#333355"> </td>
          <td width="279" height="20" align="center" valign="middle" bgcolor="#333355"><span class="style26">Subject</span></td>
          <td width="58" height="20" align="center" valign="middle" bgcolor="#333355"><span class="style26">Posts</span></td>
          <td width="213" height="20" align="center" valign="middle" bgcolor="#333355"><span class="style26">Last Post </span></td>
          </tr>
	  <?php
	  $forumsql = mysql_query("SELECT * FROM `forum_catagories` ORDER BY `forum_catagories`.`sort` ASC");
	  while($forum_row = mysql_fetch_array($forumsql)){
	  $forumid = $forum_row['cid'];
	  $postssql = mysql_query("SELECT forumid, postid, pid, name, date, time, topicid, type, title, text FROM forum_posts GROUP BY forumid WHERE forumid = '{$forumid}'");
	  $posts = mysql_num_rows($postssql);
          echo "<tr style=\"background-color:#EFF4FB;\" onMouseOver=\"this.style.backgroundColor='#E5EEF9';\" onMouseOut=\"this.style.backgroundColor='#EFF4FB';\">";
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid" height="30px">'.$forum_row1.'</td>';
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid">'.$forum_row['name'].'</td>';
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid">'.$posts.'</td>';
          echo '<td class="cursor_link" style="border-bottom:1px align="center" valign="middle" #333355 solid">'.$forum_row1.'</td>';
          echo '</tr>';
	  }
	  ?>
        </table>

Link to comment
Share on other sites

I am trying to make it more complicated than it needs to be...

 

<?php
//From
$postssql = mysql_query("SELECT forumid, postid, pid, name, date, time, topicid, type, title, text FROM forum_posts GROUP BY forumid WHERE forumid = '{$forumid}'");
//To
$postssql = mysql_query("SELECT * FROM forum_posts WHERE forumid = '{$forumid}'");
?>

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.