Hulp met kleine query

Gestart doorFreestyle3 reacties47 weergaven

4 berichten · pagina 1 van 1

Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een query om abbonees toetevoegen voor mijn nieuwsbrief.
En dan krijg ik deze error:

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 VALEUS (marijn, marijn-kok@live.nl, 22-Sunday-2011 14:22,  at line 2


Maar ik snap niet wat er fout aan isconfused
Als ik or die(mysql_error()) weg haal. dan doet ie het. hij voegt alleen niemand toe.

code:

[COLOR= #0000BB]<?php
        $datum[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"d-l-Y H:i"[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$ip[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/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]voegtoe[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]])) {[/COLOR]
            [COLOR= #0000BB]$error[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]U bent vergeten uw naam in te vullen![/COLOR][COLOR= #007700];
        }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR]
            [COLOR= #0000BB]$error[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]U moet wel een Email adress invullen![/COLOR][COLOR= #007700];
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO nieuwsbrief (naam, email, datum, ip)
                        VALEUS ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
                                "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
                                "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$datum[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]",
                                "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ip[/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]
            [COLOR= #0000BB]$voltooid[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]U bent succes vol toegevoegd![/COLOR][COLOR= #007700];
        }
    }[/COLOR]
?>


Alvast bedankt
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Geef database structuur is?
0
Berichten
1.160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
VALEUS => VALUES

gebruik ook mysql_real_escape_string biggrin
0
Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ordian schreef:
VALEUS => VALUES

gebruik ook mysql_real_escape_string biggrin
Bedankt zit nu op iPod dus kijk straks of het werk. Ik was mysql_real_escape vergeten

Het is gelukt
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