hey dman... i have found that the rest of the form upodates tho its just the message 1 that is not surly strange? lol
i have changed few errors ect but the message is still not updating the wierd thing is, is that when i got an error i got told that the message area was blank :S like so UPDATE `sysmsg` SET sent_by`='Admin', `subject`='321', `message`='', `sent_date`='1207822877' WHERE `msg_id`=''
it updates everything but the message
also the date isi got Date: Thu 04 2008 but this could be any thu in the month is there away so its shows 10-04-2008
PHP Code:
<?php session_start(); require_once '../settings.php'; checkLogin ('1');
$qProfile = "SELECT * FROM sysmsg ORDER BY msg_id DESC"; $rsProfile = mysql_query($qProfile);
while($row = mysql_fetch_array($rsProfile)){ $msg_id = $row['msg_id']; $sent_on = $row['sent_on']; $sent_by = $row['sent_by']; $subject = $row['subject']; $message = $row['message']; $datetime = $row['sent_date']; echo("<p>Subject: <b>".$subject."</b></p><p><i>Posted by:".$sent_by." on ".$sent_on."</i> - Date: ".date("D m Y",$datetime)."</p> <p>".$message."<br><br></p>"); } mysql_close();
if($id == 1){ echo "<a href=\"http://www.runningprofiles.com/members/index.php?page=admin\">Admin Index</a>\n"; }
?>
PHP Code:
<a href="../index.php">Back to index</a><br> <br> <?php include("connect.php");
// $msg_id should not change - do not let the user change this, use the message id to find the message you are wanting to edit. $msg_id = mysql_escape_string($_POST['msg_id']); $sent_on = mysql_escape_string($_POST['sent_on']); $sent_by = mysql_escape_string($_POST['sent_by']); $subject = mysql_escape_string($_POST['subject']); $message = mysql_escape_string($_POST['$message']);
// This gives the unix timestamp of the current time down to the second. $timedate = time();
// make sure $msg_id POSTED from the previous page is an id that you want to change. ALSO make sure `sent_date` field exists. $update = "UPDATE `sysmsg` SET `sent_on`='$sent_on', `sent_by`='$sent_by', `subject`='$subject', `message`='$message', `sent_date`='$timedate' WHERE `msg_id`='$msg_id' "; $rsUpdate = mysql_query($update) or die("Mysql Query Error For:<br />".$update."<br /><br />MySQL Said: ".mysql_error()); if (mysql_affected_rows() >= 1) { echo "Update successful."; }else{ echo "No rows were updated"; } mysql_close(); ?>
this is not the main issue tho as the message is strange can any 1 help ??
|