SQL Syntax fejl
Hejsa,måske nogen kan hjælpe mig med en løsning på nedenstående:
Jeg får denne fejl, når jeg prøver at aflæse siden:
Oprettede nyheder. 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 '' at line 1
Sidens kildekode:
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>Administration : Oprettede nyheder</h1>
Oprettede nyheder.
<?php
include_once('../access/access_config.php');
if (isset($_GET['deleteID'])) {
mysql_query("DELETE FROM news WHERE id=".$_GET['deleteID']."") or die(mysql_error());
}
$query = mysql_query("SELECT id,title FROM news ORDER BY id DESC LIMIT ".$offset.",".$cfg['limit']."") or die(mysql_error());
echo '<ul>';
while ($row = mysql_fetch_assoc($query)) {
echo '<li>[<a href="?offset='.$offset.'&deleteID='.$row['id'].'">Slet</a>] ';
echo '[<a href="news.edit.php?offset='.$offset.'&id='.$row['id'].'">Rediger</a>] ';
echo $row['title'].'</li>';
}
echo '</ul>';
echo ($offset >= $cfg['limit']) ? '<a href="?offset='.($offset-$cfg['limit']).'">Forrige</a> ' : 'Forrige ';
for ($start=$start_point;$start<$end_point;$start=$start+$cfg['limit']) {
echo ($offset == $start) ? '<b>'.$page_number++.'</b> ' : '<a href="?offset='.$start.'">'.$page_number++.'</a> ';
}
echo ($total > $offset+$cfg['limit']) ? '<a href="?offset='.($offset+$cfg['limit']).'">Næste</a>' : 'Næste';
?>
<div class="hr"></div>
<a href="administration.php">Administration</a> | Intet
</body>
</html>
