insanemonkey
12-11-2007, 10:37 PM
ok I am making a delete page for my forum and i got everything completed, it works fine and everything but this is my code..
include "connect.php";
$delnum = $number;
mysql_query("DELETE FROM forum WHERE postid='$delnum'")
or die(mysql_error());
but i use this for my forum and i have a seperate table called replies and it adds +1 everytime there is a reply but i want to know how i can make is subtract one everytime i delete a reply that it will subtract one
I dont know if this would be under php or mysql, sorry if i was wrong.
example:
10 replies delete one goes to 9 replies. but i delete one it still says 10 replies but there is only 9
include "connect.php";
$delnum = $number;
mysql_query("DELETE FROM forum WHERE postid='$delnum'")
or die(mysql_error());
but i use this for my forum and i have a seperate table called replies and it adds +1 everytime there is a reply but i want to know how i can make is subtract one everytime i delete a reply that it will subtract one
I dont know if this would be under php or mysql, sorry if i was wrong.
example:
10 replies delete one goes to 9 replies. but i delete one it still says 10 replies but there is only 9