Fejl i php side
Nogen der kan hjælpe mig med denne lille fejl?Fejlen:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /customers/nixx.dk/nixx.dk/httpd.www/includes/classes.php on line 39
Siden:
<?
require "header.php";
require "subheader.php";
require "navigation.php";
require "sidebar.php";
echo "</td>
<td width=\"10\"></td>
<td valign=\"top\">\n";
tablebreak();
if (empty($cat_id)) {
opentable("Knallerter");
$result = dbquery("SELECT * FROM ".$x2_prefix."Knallert_cats ORDER BY Knallert_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$columns = 2;
$counter = 0;
$tab = "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" class=\"body\">
<tr>\n";
while($data = dbarray($result)) {
$result2 = dbquery("SELECT count(Knallert_cat) FROM ".$x2_prefix."Knallerter WHERE Knallert_cat='$data[Knallert_cat_id]'");
$num = dbresult($result2, 0);
if($counter % $columns == 0) {
$tab .= "</tr>
<tr>\n";
}
$tab .= "<td align=\"center\" valign=\"top\" width=\"40%\"><a href=\"$PHP_SELF?cat_id=$data[Knallert_cat_id]\">$data[Knallert_cat_name]</a> <span class=\"small2\">($num)</span>";
if ($data[Knallert_cat_description] != "") {
$tab .= "<br>
<span class=\"small\">".stripslashes($data[Knallert_cat_description])."</span>";
}
$tab .= "</td>\n";
$counter = $counter + 1;
}
$tab .= "</tr>
</table>\n";
echo $tab;
} else {
echo "<br><div align=\"center\"><h3><b><u>Siden er, under opbygning!</u></b></h3>
Hvis du har et svar på fejlen, så kontakt Admin!</div><br>
<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" class=\"body\">
<tr>
<td align=\"center\">Ingen Knallert kategorier, blev fundet</td>
</tr>
</table>\n";
}
closetable();
} else {
$result = dbquery("SELECT * FROM ".$x2_prefix."Knallert_cats WHERE Knallert_cat_id='$cat_id'");
$data = dbarray($result);
$cat_name = stripslashes($data[Knallert_cat_name]);
opentable("Knallerter: $cat_name");
$itemsperpage = 15;
$result = dbquery("SELECT * FROM ".$x2_prefix."Knallerter WHERE Knallert_cat='$cat_id'");
$rows = dbrows($result);
if (!$rowstart) {
$rowstart = 0;
}
if ($rows != 0) {
$totalpages = ceil($rows / $itemsperpage);
$currentpage = $rowstart / $itemsperpage + 1;
$result = dbquery("SELECT * FROM ".$x2_prefix."Knallerter WHERE Knallert_cat='$cat_id' ORDER BY Knallert_name LIMIT $rowstart,$itemsperpage");
$numrows = dbrows($result);
$i = 1;
while ($data = dbarray($result)) {
$dateposted = strftime("%d.%m.%y", $data[Knallert_datestamp]+($settings[timeoffset]*3600));
if ($data[Knallert_datestamp]+604800 > time()+($settings[timeoffset]*3600)) {
$new = " <span class=\"small\">[NEW]</span>";
} else {
$new = "";
}
echo "<a href=\"$PHP_SELF?cat_id=$cat_id&Knallert_id=$data[Knallert_id]\" target=\"_blank\">".stripslashes($data[Knallert_name])."</a>$new<br>\n";
if ($data[Knallert_description] != "") {
echo stripslashes($data[Knallert_description])."<br>\n";
}
echo "<span class=\"small\"><font class=\"alt\">Skrevet:</font> $dateposted | <font class=\"alt\">Visits:</font> $data[Knallert_count]</span>\n";
if ($i != $numrows) {
echo "<br><br>\n";
} else {
echo "\n";
}
$i++;
}
closetable();
if ($rowstart >= $itemsperpage) {
$start = $rowstart - $itemsperpage;
$prev = "<a href=\"$PHP_SELF?cat_id=$cat_id&rowstart=$start\" class=\"white\">Forrige</a>";
}
if ($rowstart + $itemsperpage < $rows) {
$start = $rowstart + $itemsperpage;
$next = "<a href=\"$PHP_SELF?cat_id=$cat_id&rowstart=$start\" class=\"white\">Næste</a>";
}
if ($prev != "" || $next != "") {
$current = "Page $currentpage of $totalpages";
tablebreak();
prevnextbar($prev,$current,$next);
}
} else {
echo "Ingen Knallerter er blevet tilføjet i denne kategori\n";
closetable();
}
}
tablebreak();
echo "</td>
<td width=\"10\"></td>
<td width=\"170\" valign=\"top\" class=\"srborder\">\n";
require "userinfo.php";
require "poll.php";
require "shoutbox.php";
echo "</td>
</tr>
</table>\n";
require "footer.php";
?>