Jump to content

NUM_ROWS


Cooper94

Recommended Posts

<?php include 'inc/header.php'; 
include 'data.php';
?>

<?php include 'inc/side.php'; ?>

<div id="main_content">
	<div id="new_item">
<?php
$result = mysql_query("SELECT * FROM news WHERE id = '{$_GET[id]}'");
$num = mysql_num_rows($result);
$row = mysql_fetch_assoc($result);
?>

		<div id="new_item_header">
		<h1><?php echo $row['subject']; ?>!</h1>
		</div>
		<div id="new_item_text">				
			<p>
<?php 
echo $row['body'];
?>
</p> 


		</div>

<?php include 'inc/footer.php'; ?>

 

I get this error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cmxvacom/public_html/site/fullevents.php on line 11. Any ideas on how to fix this any help would be great, thank you guys!

 

Link to comment
Share on other sites

Were it says include 'inc/side.php' this is the side code:

 

<div id="left_sidebar"><br>
	<div id="categories">
		<div id="categories_header">
		<h2>Newest Airlines</h2>
		</div>
		<ul>
<?php 
include 'data.php';
$result = mysql_query("SELECT * FROM airlines ORDER BY date DESC LIMIT 5");
echo "<table  width=100%>
<tr>
<th>Name</th>
<th>Date</th>
</tr>";
while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td><a href=$row[url]>$row[name]</a></td>";
  echo "<td>$row[date]</td>";
  echo "</tr>";
  }
echo "</table>";
?>

		</ul>
                  <br>
		<div id="categories_header">
		<h2>Partners</h2>
		</div>
		<ul>
<a href="http://www.czwgfir.org/"><img src="images/ywg.jpg" /></a>
		</ul>
                  <br>
		<div id="categories_header">
		<h2>Latest Forum Topics</h2>
		</div>
		<ul>
<?php 
include 'fdata.php';
$results = mysql_query("SELECT * FROM phpbb_topics WHERE forum_id = '2' ORDER BY topic_time DESC LIMIT 3");
echo "<table  width=100%>
<tr>
<th>Subject</th>
<th>Posted By</th>
</tr>";
while($rows = mysql_fetch_array($results))
  {
  echo "<tr>";
  echo "<td><a href=http://cmxva.com/site/phpBB3/viewtopic.php?f=$rows[topic_id]&t=$rows[topic_id]>$rows[topic_title]</a></td>";
  echo "<td>$rows[topic_first_poster_name]</td>";
  echo "</tr>";
}
echo "</table>";
?>
		</ul>
		<div class="clearthis"> </div>
	</div>
</div>

 

I hope that helps some thank you again for your help!

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.