mysql query (update)

Gestart doorFreestyle4 reacties11 weergaven

5 berichten · pagina 1 van 1

Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb nog nooit de functie update gebruikt in een mysql query.
En ik heb er nu dus eentje gemaakt via w3schools.
maar hij doet het niet.

Mijn vraag wat is er fout aan?
ik krijg geen error

de query:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET avatar = "[/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]avatar[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]",
                                          website = "[/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]website[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]",
                                          onderschrift = "[/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]onderschrift[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]",
                                          nieuwsbrief = "[/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]nieuwsbrief[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"
                                          kvk = "[/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]kvk[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]",
                                          land = "[/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]"
                        WHERE user = "[/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]user[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat doet het er dan niet aan?
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je mist bij sommige een komma.
0
Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
het is al opgelost via msn
zo moet het:

mysql_query("UPDATE users SET avatar=" . ($_POST[avatar]) . ", 
                                          website=" . ($_POST[website]) . ",
                                          onderschrift=" . ($_POST[onderschrift]) . ",
                                          nieuwsbrief=" . ($_POST[nieuwsbrief]) . ",
                                          kvk=" . ($_POST[kvk]) . ",
                                          land=" . ($_POST[land]) . "
            WHERE user=" . ($_SESSION[user]) . "");


mods: het hoeft niet opslot als er iemand met een beter oplossing komt dan is dat beterwink
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat zei ik net: Je mist kommas
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