//Problemen zijn opgelost bedankt!
Dubbel check fout
$res = mysql_query("SELECT * FROM coupons WHERE code = $serial");
moet
$res = mysql_query("SELECT * FROM coupons WHERE code = $serial");
zijn
moet
$res = mysql_query("SELECT * FROM coupons WHERE code = $serial");
zijn
Error is nu verholpen ja, maar hij checkt hem niet..
Ik zie die kleine fouten maar niet zoals hier;
Wat is hier mis mee?

Ik zie die kleine fouten maar niet zoals hier;
mysql_query("UPDATE coupons SET code=$code, author=$waarde WHERE id = $id"); Wat is hier mis mee?
[COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])[/COLOR] OR [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]Voeg de code hier in[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt geen code ingevuld. <a href="javascript:history.go(-1)"><b>ga terug</b> "[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarde[/COLOR][COLOR= #007700]])[/COLOR] OR [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarde[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]Waarde van de coupon[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt geen waarde ingevuld."[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]expire[/COLOR][COLOR= #007700]])[/COLOR] OR [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]expire[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]Geldig tot[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt geen verloop datum ingevuld.<a href="javascript:history.go(-1)"><b>ga terug</b> "[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$lengte[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lengte[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]16[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De code die u heeft ingevoerd is te kort. <a href="javascript:history.go(-1)"><b>ga terug</b>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$serial[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$res[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM coupons WHERE code = $serial"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$rows[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$res[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[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]code[/COLOR][COLOR= #007700]]));[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[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]waarde[/COLOR][COLOR= #007700]]));[/COLOR]
[COLOR= #0000BB]$expire[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[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]expire[/COLOR][COLOR= #007700]]));[/COLOR]
[COLOR= #0000BB]$adddate[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"H:i:s d.m.Y"[/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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO coupons(code, author, date, adddate, ip) VALUES ($code, $waarde, $expire, $adddate, $ip)"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De code is succesvol aan de database toegevoegd. <a href="javascript:history.go(-1)"><b>ga terug</b> "[/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]"Deze code is helaas als eens toegevoegd."[/COLOR][COLOR= #007700];
}
}
}[/COLOR]
?> Edit; Zet achter je querys overal eens or die(mysql_error());
Nathan is php noob hoor...
Waarom wilt ie in de admin niet editen?

[COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]go[/COLOR][COLOR= #007700]])) :[/COLOR]
?>
<form method="post" action="">
<input type="text" value="Code" name="code" onFocus="this.value=" /><input type="text" value="Waarde van coupon" name="waarde" onFocus="this.value=" /><br />
<input type="submit" value="Pas aan" name="go" />
</form>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]])) :[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er is geen code ingevuld."[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarde[/COLOR][COLOR= #007700]])) :[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er is geen waarde ingevuld."[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]:[/COLOR]
[COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarde[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE coupons SET code=$code, author=$waarde WHERE id = $id"[/COLOR][COLOR= #007700]);
endif;
endif;[/COLOR]
?> Waarom wilt ie in de admin niet editen?
Vul is bij action="" je pagina titel + exentie.
Je bedoelt: