Hi,
Ik ben bezig met een nieuws reactie systeem maar nu krijg ik het volgende:
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 [news_reply] ( newsid, poster, postime, bericht) VALUES (, , NOW()) ,hggh at line 1
Weet iemand wat er mis is?
Code:
Ik ben bezig met een nieuws reactie systeem maar nu krijg ik het volgende:
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 [news_reply] ( newsid, poster, postime, bericht) VALUES (, , NOW()) ,hggh at line 1
Weet iemand wat er mis is?
Code:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"GREETING"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Reageer"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]../inc/header.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]../inc/config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je moet alle velden invullen.[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$dbres2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT *,DATE_FORMAT(`time`,%d-%m-%Y %H:%i) AS `time` FROM `[news]` WHERE online = 1 AND `id`= "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" ORDER BY `id` DESC LIMIT 2"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$dbres2[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO [news_reply] ( newsid, poster, postime, bericht) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]newsid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]", NOW()) ,"[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je reactie is succesvol toegevoegd.[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<form actiom="" method="post">
<table>
<tr>
<td>Bericht:</strong></td><td><textarea name="bericht" cols=40 rows=10></textarea></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Verzenden"></td>
</tr>
</table>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]../inc/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?> 
