query word niet goed gedaan

Gestart doorOne2xs4 reacties17 weergaven

5 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ik heb deze code:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"header.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>
<h2>contact opnemen</h2>
<form name="contact" id="1" method="post" action="?verzend">
wat is uw naam?<br />
<INPUT TYPE="text" NAME="naam" VALUE="uw naam"><br />
wat is het onderwerp?<br />
<INPUT TYPE="text" NAME="vraag" VALUE="onderwerp hierzo"><br />
wat is uw bericht?<br />
<input NAME="verhaal" type="text" VALUE="bericht hierzo"><br />
klik op verstuur om uw bericht te versturen<br />
<INPUT TYPE="submit" NAME="submit" VALUE="verstuur"><br />
</FORM>
        [COLOR= #0000BB]<?php[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]){[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO `contact` (id, naam, vraag, verhaal) VALUES (NULL, "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vraag[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verhaal[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/print"]print[/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]" Succesvol bericht verstuurd"[/COLOR][COLOR= #007700];
        }[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>


en als ik verstuur krijg ik in DB:
id    naam    vraag                    verhaal
    1    0            onderwerp hierzo    0


hoe komen die 0en daar?
SQL:

CREATE TABLE IF NOT EXISTS `contact` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `naam` int(11) NOT NULL,
  `vraag` text NOT NULL,
  `verhaal` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Omdat naam en verhaal integeners zijn?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Erik schreef:
Omdat naam en verhaal integeners zijn?
en wat bedoel je daarmee =D
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je hebt je veld type in PHPmyadmin, INTIGER( INT) gekozen.
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maak er varchars van.
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