Jump to content

[SOLVED] page not updating


runnerjp

Recommended Posts

<?php $updateemail = "UPDATE forum_email SET mailed=0 WHERE topic_id='$forumpostid'";
											mysql_query($updateemail) or die("Could not update post");// this works as it sets them to 0
$updateuseremail = "UPDATE forum_email SET mailed=1 WHERE topic_id='$forumpostid' AND user_id='$id'";
											mysql_query($updateuseremail) or die("Could not update post");// but this does not set the users one back to 1?>

Link to comment
https://forums.phpfreaks.com/topic/132969-solved-page-not-updating/
Share on other sites

sadly not... heres full code

 

<?php $query = "SELECT fe.*, u.email, u.ID FROM forum_email as fe INNER JOIN users as u ON u.ID = fe.user_id WHERE fe.topic_id = $forumpostid AND fe.user_id != $id  AND fe.mailed=1";
	$res = mysql_query($query) or die ("$query fails : ".mysql_error());
//nobody wants an email, stop now
if(mysql_num_rows($res)==0)
{
echo "no records returned";
        exit;
}

// ADDED CODE TO SEND EMAIL MESSAGES
$subj = 'Forum Updated';
$from = "From: [email protected]";
$text = ' [your message text] ';

while ($row = mysql_fetch_assoc($res)) {
        extract ($row);
        if (!mail($email, $subj, $text, $from)) {
                echo "<br />MAIL FAILED FOR $email \n";
        }
}

//set emailed to 'y' so that they don't get numerous emails... set it back to 'n' when they view this topic
$updateemail = "UPDATE forum_email SET mailed=0 WHERE topic_id='$forumpostid'";
											mysql_query($updateemail) or die("Could not update post");
$updateuseremail = "UPDATE forum_email SET mailed='1' WHERE topic_id='$forumpostid' AND user_id='$id'";
                                    mysql_query($updateuseremail) or die("Could not update post");?> 

try some valadation to see if it correct in the update then.........

 

 

also i dont see no $_post[''] varables........

<?php

$updateuseremail = "UPDATE forum_email SET mailed='1' WHERE topic_id='$forumpostid' AND user_id='$id'";

                                   mysql_query($updateuseremail) or die("Could not update post mysql_error()");
echo $updateuseremail;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.