UPDATE query doet raar?

Gestart doorSebastiaanh4 reacties40 weergaven

5 berichten · pagina 1 van 1

Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo One2XS,

Voor mijn nieuwe project ben ik bezig om een forum te scripten. Alles verliep tot nu toe goed, maar nu lukt iets niet. Als ik een startpost verander, laat hij in het topic 0 zien. Als ik een titel verander, werkt het wel gewoon. Wie weet wat er fout is? confusedQuery:

$editStaffTopic = mysql_query("UPDATE topics SET startpost = " . $forum->escape($_POST[startpost]) . " AND naam = " . $forum->escape($_POST[titel]) . " WHERE id = " . $forum->escape($_GET[id]) . "") or die(mysql_error());


Mvg,
SebastiaanH
0
Berichten
10.409
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Print de variabelen eens.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
And werkt alleen in een where. Niet in een set.
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?
$editStaffTopic[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE topics SET startpost = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$forum[/COLOR][COLOR= #007700]->[/COLOR]escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]startpost[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", naam = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$forum[/COLOR][COLOR= #007700]->[/COLOR]escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$forum[/COLOR][COLOR= #007700]->[/COLOR]escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/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]
?>
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
In UPDATE gebruik je dus kommas ipv AND
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