Wie kan mij helpen hiermee?
Foutmelding:
Er is een fout opgetreden in de query:
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 1 at line 1
dit is een deel van de code waar het om gaat:
De gegevens worden wel toegevoegd in de database maar de rest voert het script niet uit.
En het vreemde is, ik heb exact dezelfde code op een andere host staan en daar werkt die wel correct, dus ik snap er helemaal niks van...
Foutmelding:
Er is een fout opgetreden in de query:
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 1 at line 1
dit is een deel van de code waar het om gaat:
[COLOR= #0000BB]<?php
$toevoegquery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO aankondigingen (poster, titel, bericht, datum)
VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]poster[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", NOW())"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$toevoegquery[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$usql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT id, naam, email, bevestigd FROM abonnement WHERE bevestigd=1"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$usql[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ufetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$usql[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #FF8000]//[knip > staan dingen zoals $headers, $bericht enz voor het verzenden van een mail naar verschillende adressen die in de datbase staan][/COLOR]
[COLOR= #0000BB]$mail[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ufetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]],[/COLOR][COLOR= #DD0000]"Nieuwe aankondiging "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sitenaam[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$headers[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"From: "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sitenaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" <"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sitemail[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]">"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mail[/COLOR] [COLOR= #007700]==[/COLOR] TRUE[COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div style="width: 400px; margin: 0 auto; text-align: center;">
De aankondiging is geplaatst op de homepagina en de abonnement mailtjes zijn verstuurd</div>[/COLOR][COLOR= #007700];
}
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />Er is een fout opgetreden in de query: <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR]
?> De gegevens worden wel toegevoegd in de database maar de rest voert het script niet uit.
En het vreemde is, ik heb exact dezelfde code op een andere host staan en daar werkt die wel correct, dus ik snap er helemaal niks van...






geen mysql_real_escape_string