PHP-Code:
<?php
echo "<br>
<div id='content'>";
if (!isset($download)) {
$download = 0;
}
if($_SESSION['logon'] == '1')
{
$query_anzahl = "SELECT * FROM downloads WHERE aktiv='1' AND update='1';";
$result_anzahl = mysql_query($query_anzahl) OR die(mysql_error());
$anzahl = mysql_num_rows($result_anzahl);
$navigation ='';
$next_page = $download+5;
$prev_page = $download-5;
if ($prev_page >= 0)
{
$navigation = "<a href=\"index.php?action=downloads&download=$prev_page\">Vorherige Seite</a>\n";
}
if ($next_page < $anzahl)
{
$navigation = $navigation. " <a href=\"index.php?action=downloads&download=$next_page\">Nächste Seite</a>\n";
}
$sql = "SELECT * FROM downloads WHERE aktiv='1' AND update='1' LIMIT $download, 5;";
$result = mysql_query($sql) OR die(mysql_error());
$row = mysql_fetch_assoc($result);
}
else
{
$query_anzahl = "SELECT * FROM downloads WHERE aktiv='1' AND update='0';";
$result_anzahl = mysql_query($query_anzahl);
$anzahl = mysql_num_rows($result_anzahl);
$navigation ='';
$next_page = $download+5;
$prev_page = $download-5;
if ($prev_page >= 0)
{
$navigation = "<a href=\"index.php?action=downloads&download=$prev_page\">Vorherige Seite</a>\n";
}
if ($next_page < $anzahl)
{
$navigation = $navigation. " <a href=\"index.php?action=downloads&download=$next_page\">Nächste Seite</a>\n";
}
$sql = "SELECT * FROM downloads WHERE aktiv='1' AND update='0' LIMIT $download, 5;";
$result = mysql_query($sql) OR die(mysql_error());
$row = mysql_fetch_assoc($result);
}
echo "</div>";
?>
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\downloads.php on line 33
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'update='0' LIMIT 0, 5' at line 1
jedoch wird in Zeile 33 die Anzahl ermittelt!!!
was stimmt hier nicht?
Kommentar