Reactie systeem

Gestart doorShahiem5 reacties40 weergaven

6 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
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:

[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]
?>
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
[news_reply]

[ en ] kan je niet gebruiken tenzij je backticks `` gebruikt denk ik.
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik krijg het nog steeds sadley
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Probeer dit is:

mysql_query("INSERT INTO [news_reply] ( newsid, poster, postime, bericht) VALUES (".$message[newsid].", ". $_SESSION[id] .", NOW()) ," . mysql_real_escape_string($_POST[bericht]) . "") or die(mysql_error());
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
werkt niet
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Andere tabelnaam gebruiken, niet met rare tekens die sowieso niet in een tabelnaam horen? emo
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren