Posted: Wed May 30, 2007 6:06 am
ok,
so ive changed the link to look like this
and my page that the link goes to which is the delete_answer.php the code is
i have tried this and its deleting the answer as before, but not minusing the replies down by 1 still, i think were getting there thou.
You have been a massive help, but any other ideas why this is still not doing this??
Many Thanks
Chris
so ive changed the link to look like this
Code: Select all
<td colspan="3" bgcolor="#F8F7F1"><a href="../forumgeneral/delete_answer.php?a_id=<? echo $rows['a_id']; ?>&question_id=<? echo $rows['question_id']; ?>" class="style8"><? echo Yes; ?></a></td>Code: Select all
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Get values from form.
$a_id=$_GET['a_id'];
// Do delete statement.
mysql_query("delete from forum_answer where a_id='$a_id'");
$tbl_name2="forum_question"; // Switch to table "forum_question"
// Get values from form.
if ( !isset($_GET['question_id']) ) {
echo '<pre>_GET: '; print_r($_GET); echo "</pre>\n";
die('missing parameter');
}
$question_id=(int)$_GET['question_id'];
$query = "UPDATE forum_question SET reply=reply-1 WHERE id=$question_id";
mysql_close();
// Redirect to select.php.
header("location:main_forum.php");
?>You have been a massive help, but any other ideas why this is still not doing this??
Many Thanks
Chris