Hey
Waarom zet deze PHP code niets in de database?
Kan iemand mij helpen?
Alvast bedankt!
Jordyvc
Waarom zet deze PHP code niets in de database?
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$NaamCheckQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM klanten WHERE gebruikersnaam="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" LIMIT 1"[/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]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$NaamCheckQuery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$nQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM klanten"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$nFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$nQuery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$ProductQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM product ORDER BY id DESC LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$ProductFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ProductQuery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$PrijsQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT prijs FROM product ORDER BY id DESC LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$PrijsFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$PrijsQuery[/COLOR][COLOR= #007700]);[/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]
[COLOR= #0000BB]$post[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO bestelling (id, naam, voornaam, land, provincie, gemeente, postcode, straat, nummer, product, kleur, eenheidsprijs, betaalmethode, aantal)
VALUES
("[/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]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/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]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/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]voornaam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/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]land[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/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]provincie[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]gemeente[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]postcode[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]straat[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]nummer[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]product[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]kleur[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/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]eenheidsprijs[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/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]betaalmethode[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]aantal[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]",)"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$post[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het is momenteel niet mogelijk om iets te bestellen! <br />"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]] >=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Bestelling maken:"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<form action= method=post>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<u>Klanten gegevens:</u><br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Naam: <input type="text" name="naam" value="[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" readonly="readonly" /> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Voornaam: <input type="text" name="text" value="[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]voornaam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" readonly="readonly" /> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Land: <input type="text" name="land" value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]land[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]" readonly> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Provincie: <input type="text" name="provincie" value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]provincie[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]" readonly> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Gemeente: <input type="text" name="gemeente" value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gemeente[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]" readonly> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Postcode: <input type="text" name="postcode" value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]postcode[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]" readonly> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Straat: <input type="text" name="straat" value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]straat[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]" readonly> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input type="text" name="nummer" value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$nFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nummer[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]" readonly> <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Zijn dit niet de juist gegevens? Dit zijn jou gegevens die je hebt ingegeven bij het registreren. Wil je deze gegevens veranderen? Het beste is om dan een admin te contacteren via de contact pagina! Deze gegevens zijn noodzakelijk voor het verzenden van de goederen! <br /><br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<u>Product gegevens:</u><br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Product: <input type="text" naam="product" value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$ProductFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]" readonly><br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Kleur: <select name="kleur"><option value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$ProductFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ProductFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]</option><option value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$ProductFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur2[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]">[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$ProductFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur2[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]</option><option value="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$ProductFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur3[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]"> [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ProductFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur3[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]</option></select><br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Eenheidsprijs: [/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$PrijsFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]prijs[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Betaalmethode: <select name="betaalmethode"><option value="PayPal">PayPal</option><option value="PayOnDeliver">Pay On Deliver +5 euro</option></select><br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Aantal: <select name="aantal"><option value="1">1</option><option value="2">2</option><option value="3">3</option></select>Als je meer dan 3 wilt bestellen kan je ons even contacteren!<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<input type=submit value=bestellen! />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</form>"[/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]"Je hebt geen koperscode, je kan dus niets bestellen! Koop hiervoor eerst een koperscode! <br />"[/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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je bent niet ingelogd, om deze pagina te bezoeken moet je eerst ingelogd zijn!<br />"[/COLOR][COLOR= #007700];
}[/COLOR]
?> Kan iemand mij helpen?

Alvast bedankt!
Jordyvc
