Hallo, dit is mijn eerste ervaring op een forum en hoop dat ik hier iets goeds aan overhoud.
Kan iemand me helpen ivm met mijn zelfgeschreven gastenboek?
Deze foutmelding krijg ik:
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 '-10,10' at line 1
mijn code is(het is alleen de inhoud omdat ik een paging methode gebruik, hij laad de content in vanop de index.php.
HELP
index.php:
Hier is de index.php
Kan iemand me helpen ivm met mijn zelfgeschreven gastenboek?
Deze foutmelding krijg ik:
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 '-10,10' at line 1
mijn code is(het is alleen de inhoud omdat ik een paging methode gebruik, hij laad de content in vanop de index.php.
HELP
index.php:
PHP:
<div class="subtitle">
Ons gastenboek
</div>
<div class="maintekst">
Aanschouw het gastenboek van onze schutterij,<br />
Wil je jouw bericht in ons gastenboek zien verschijnen?<br />
Het kan, het enige wat je moet doen is <a href="index.php?page=schrijven">hier</a> je bericht schrijven.
</div>
<div class="maintekst">
<?php
include("page/dbconnect.php");
$sql = "SELECT * FROM gastenboek";
$uitvoer = mysql_query($sql);
$aantal = mysql_num_rows($uitvoer)
or die(mysql_error);
$perpage = 10;
$page = (isset($_GET['page'])) ? $_GET['page'] : 1;
$start = ($page * $perpage) - $perpage;
$sql = "SELECT * FROM gastenboek ORDER BY id DESC LIMIT ".$start.",".$perpage."";
$uitvoer = mysql_query($sql) or die(mysql_error());
while($data = mysql_fetch_array($uitvoer)){
echo '<div class="info"><div style="float: left;">'.$data['naam'].'</div><div style="float: right;"><img src="images/main/calendar.png" /></div>"<div style="float: right;">'.$data['datum'].' om '.$data['tijd'].'</div></div>';
$bericht = nl2br($data['bericht']);
echo '<div class="maintekst">'.$bericht.'</div>';
echo "<br /><br />";
}
echo"<br /><br />";
if ($page > 1){
$vorige = $page-1;
echo '<div class="prevpg"><font color="#6499FD"><a href="gastenboek.php?page='.$vorige.'">Vorige</a></font></div>';
}
else{
echo '<div class="prevpg"><font color="#CDDEFE">Vorige</font></div>';
}
if ($page < ceil($aantal/$perpage)){
$volgende = $page+1;
echo '<div class="nextpg"><font color="#6499FD"><a href="gastenboek.php?page='.$volgende.'">Volgende</a></font></div>';
}
else{
echo '<div class="nextpg"><font color="#CDDEFE">Volgende</font></div>';
}
?>
</div>
Hier is de index.php
PHP:
<?php
function pagina() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$pagename1 = str_replace('/','',strrchr(pagina(),'/'));
if (($_GET["page"])== "schutterij") {
$title = "Schutterij";
}
if (($_GET["page"])== "bestuur") {
$title = "Bestuur";
}
if (($_GET["page"])== "kalender") {
$title = "Kalender";
}
if (($_GET["page"])== "fotogallerij") {
$title = "Fotogallerij";
}
if (($_GET["page"])== "uitslagen") {
$title = "Uitslagen";
}
if (($_GET["page"])== "memoriam") {
$title = "In memoriam";
}
if (($_GET["page"])== "koningen") {
$title = "Koningen";
}
if (($_GET["page"])== "contact") {
$title = "Contact";
}
if (($_GET["page"])== "gastenboek") {
$title = "Gastenboek";
}
if (($_GET["page"])== "schrijven") {
$title = "Schrijf een bericht in ons gastenboek";
}
if (($_GET["page"])== "termsofuse") {
$title = "Terms of use";
}
if (($_GET["page"])== "sitemap") {
$title = "Sitemap";
}
if (($_GET["photopage"])== "2007js") {
$title = "Fotogallerij - Jaarlijkse souper 2007";
}
if (($_GET["photopage"])== "2007bmc") {
$title = "Fotogallerij - Beker Meester Creemers 2007";
}
if (($_GET["photopage"])== "2007ks") {
$title = "Fotogallerij - Koningsschieten 2007";
}
if (($_GET["photopage"])== "2008js") {
$title = "Fotogallerij - Jaarlijkse souper 2008";
}
if (($_GET["photopage"])== "2008ks") {
$title = "Fotogallerij - Koningsschieten 2008";
}
if (($_GET["photopage"])== "2008fam") {
$title = "Fotogallerij - Familiedag 2008";
}
if (($_GET["photopage"])== "2009js") {
$title = "Fotogallerij - Jaarlijkse souper 2009";
}
if (($pagename1)== "index.php") {
$title = "Home - Welkom!";
}
if (($pagename1)==""){
$title = "Home - Welkom!";
}
if ((($_GET["page"]) <> "schutterij") and (($_GET["page"]) <> "bestuur") and (($_GET["page"]) <> "kalender") and (($_GET["page"]) <> "fotogallerij") and (($_GET["page"]) <> "uitslagen") and (($_GET["page"]) <> "memoriam") and (($_GET["page"]) <> "koningen") and (($_GET["page"]) <> "contact") and (($_GET["page"]) <> "gastenboek") and (($_GET["page"]) <> "schrijven") and (($_GET["page"]) <> "termsofuse") and (($_GET["page"]) <> "sitemap") and (($_GET["photopage"]) <> "2007js") and (($_GET["photopage"]) <> "2007bmc") and (($_GET["photopage"]) <> "2007ks") and (($_GET["photopage"]) <> "2008js") and (($_GET["photopage"]) <> "2008ks") and (($_GET["photopage"]) <> "2008fam") and (($_GET["photopage"]) <> "2009js") and (($pagename1)<> "index.php") and (($pagename1)<> "")){
$title = "Foutmelding!";
}
?>
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="Koninklijke Schutterij Sint Servatius Raam Ophoven" name="description" />
<meta content="" name="keywords" />
<link href="images/main/rifle.ico" rel="shortcut icon" />
<link rel="stylesheet" href="styles/main.css" type="text/css">
<link rel="stylesheet" href="styles/photographics.css" type="text/css">
<script type="text/javascript" src="../../scripts/highslide.js"></script>
<script type="text/javascript">
hs.graphicsDir = '../../highslide/graphics/';
hs.wrapperClassName = 'wide-border';
</script>
<title>St. Servatius Raam » <?php echo "".$title.""; ?></title>
</head>
<body>
<div class="header">
<img src="images/main/header.jpg" align="middle" />
</div>
<div class="container">
<div class="left">
<div class="menu">
<a href="index.php">Home</a><br />
<a href="index.php?page=schutterij">Schutterij</a><br />
<a href="index.php?page=bestuur">Bestuur</a><br />
<a href="index.php?page=kalender">Kalender</a><br />
<a href="index.php?page=fotogallerij">Foto's</a><br />
<a href="index.php?page=uitslagen">Uitslagen</a><br />
<br />
<a href="index.php?page=memoriam">In Memoriam</a><br />
<a href="index.php?page=koningen">Koningen</a><br />
<br />
<a href="index.php?page=contact">Contact</a><br />
<a href="index.php?page=gastenboek">Gastenboek</a><br />
</div>
</div>
<div class="middle">
PHP:
<?php
if (($_GET["page"])== "schutterij") {
include ('page/schutterij.php');
}
if (($_GET["page"])== "bestuur") {
include ('page/bestuur.php');
}
if (($_GET["page"])== "kalender") {
include ('page/kalender.php');
}
if (($_GET["page"])== "uitslagen") {
include ('page/uitslagen.php');
}
if (($_GET["page"])== "memoriam") {
include ('page/memoriam.php');
}
if (($_GET["page"])== "koningen") {
include ('page/koningen.php');
}
if (($_GET["page"])== "contact") {
include ('page/contact.php');
}
if (($_GET["page"])== "gastenboek") {
include ('page/gastenboek.php');
}
if (($_GET["page"])== "schrijven") {
include ('page/schrijven.php');
}
if (($_GET["page"])== "termsofuse") {
include ('page/termsofuse.php');
}
if (($_GET["page"])== "sitemap") {
include ('page/sitemap.php');
}
if (($_GET["page"])== "fotogallerij") {
include ('page/fotogallerij.php');
}
if (($_GET["photopage"])== "2007js") {
include ('page/photopage/2007js.php');
}
if (($_GET["photopage"])== "2007bmc") {
include ('page/photopage/2007bmc.php');
}
if (($_GET["photopage"])== "2007ks") {
include ('page/photopage/2007ks.php');
}
if (($_GET["photopage"])== "2008js") {
include ('page/photopage/2008js.php');
}
if (($_GET["photopage"])== "2008ks") {
include ('page/photopage/2008ks.php');
}
if (($_GET["photopage"])== "2008fam") {
include ('page/photopage/2008fam.php');
}
if (($_GET["photopage"])== "2009js") {
include ('page/photopage/2009js.php');
}
if ((($_GET["page"]) <> "schutterij") and (($_GET["page"]) <> "bestuur") and (($_GET["page"]) <> "kalender") and (($_GET["page"]) <> "fotogallerij") and (($_GET["page"]) <> "uitslagen") and (($_GET["page"]) <> "memoriam") and (($_GET["page"]) <> "koningen") and (($_GET["page"]) <> "contact") and (($_GET["page"]) <> "gastenboek") and (($_GET["page"]) <> "schrijven") and (($_GET["page"]) <> "termsofuse") and (($_GET["page"]) <> "sitemap") and (($_GET["photopage"]) <> "2007js") and (($_GET["photopage"]) <> "2007bmc") and (($_GET["photopage"]) <> "2007ks") and (($_GET["photopage"]) <> "2008js") and (($_GET["photopage"]) <> "2008ks") and (($_GET["photopage"]) <> "2008fam") and (($_GET["photopage"]) <> "2009js") and (($pagename1)<> "index.php") and (($pagename1)<> "")){
include('page/error.php');
}
?>
HTML:
</div>
<div class="right">
<div class="menu">
<a href="http://www.maasenkempen.be/">Bond Maas & Kempen</a><br />
<a href="http://www.schutterij-as.be/">St. Sebastiaan As</a><br />
<a href="http://www.schutterij-bocholt.be/">St. Laurentius Bocholt</a><br />
<a href="http://www.manestraat.com/">St. Hubertus Manestraat</a><br />
<a href="http://schutterij.wordpress.com/">St. Sebastiaan St. Huibrechts-Lille</a><br />
<a href="http://www.schutterijsmv.be/">St. Martinus St. Martens-Voeren</a><br />
<a href="http://www.freewebs.com/schutterijbeek/">St. Catharina Beek</a>
</div>
</div>
</div>
<div class="footer">
© St. Servatius Raam All rights reserved | design & coding by <a href="index.php?page=contact">Renovatio Design</a> | <a href="index.php?page=sitemap">sitemap</a> | <a href="index.php?page=termsofuse">terms of use</a></div>
</body>
</html>