Warning: mysql_num_rows() expects parameter 1 to be resource
<?phprequire_once("pagebegin.php");
$title = "<censored> | Søg";
require_once("header.php");
$query = "";
$cat = "";
$page = 1;
if(isset($_GET['c']))
{ $query = mysql_real_escape_string($_GET['c']); }
if(isset($_GET['p']))
{ $page = mysql_real_escape_string($_GET['p']); }
if($page <= 0) { $page = 1; }
$item_count = mysql_num_rows(mysql_query("SELECT * FROM Movie_Categories WHERE category_id = ".$query));
$page_count = ceil($item_count / 6);
$begin_limit = ($page * 6)-6;
$sql = "SELECT * FROM Movie_Categories WHERE category_id = ".$query." LIMIT ".$begin_limit.",6";
$result = mysql_query($sql);
$row = mysql_fetch_array(mysql_query("SELECT * FROM Categories WHERE id = ".$query));
$category_name = $row['name']
?>
<body>
<div id="wrapper">
<div id="header">
</div>
<div id="body">
<h3><?php echo $category_name; ?></h3>
<div id="newest_uploads">
<?php
if(mysql_num_rows($result)>0) {
while($row = mysql_fetch_array($result))
{
$movie_result = mysql_fetch_array(mysql_query("SELECT * FROM Movies WHERE id = ".$row['movie_id']));
$thumb = "grafik/NoMini.jpg";
$link = $movie_result['id'];
$description = $movie_result['description'];
$name = $movie_result['name'];
if($movie_result['thumb']!="")
{
$thumb = "thumbs/".$movie_result['thumb'];
}
?>
<div class="movie_thumb">
<a href="movie.php?id=<?php echo $link; ?>" title="<?php echo $description; ?>"><img src="<?php echo $thumb; ?>"title="<?php echo $description; ?>"/></a>
<div class="filmtitle">
<center><?php echo $name; ?></center>
</div>
</div>
<?php
}
} else {
echo "Ingen resulater.";
}
?>
<div style="display:block; clear:both; width:1px;"> </div>
<?php
if($page-1>=1)
{
echo "<a href=\"category.php?c=".urlencode($query)."&p=".($page-1)."\">Forrige</a>|";
}
for($a = 1; $a <= $page_count; $a++)
{
if($a == $page) {
echo("<b>".$a."</b>|");
} else {
echo("<a href=\"category.php?c=".urlencode($query)."&p=".$a."\">".$a."</a>|");
}
}
if($page + 1 <= $page_count)
{
echo "<a href=\"category.php?c=".urlencode($query)."&p=".($page+1)."\">Næste</a>|";
}
?>
</div>
</div>
<div id="menu">
<?php
include("menu.php");
?>
</div>
</div>
</body>
</html>
Hvad er det der kan være galt?
Jeg får denne fejl når jeg går direkte ind på category.php eller når jeg går ind på category.php?c='
---->
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\category.php on line 34