I am trying to UPDATE a column in my database table, I can pull the info from the database but updating is causing me grief, the commented out code is what is meant to make the update work but when I run this I get a parse error on the last line whcich is the closing ?> tag...
PHP Code:<?php
/* connect to the mysql database and use different queries for the count of members */
include 'library/config.php';
include 'library/opendb.php';
//navigation
include("nav.php");
//if (isset($_REQUEST['Submit2'])) {
$status = $_REQUEST['status'];
//$email = $_REQUEST['txtboxEmailBody'];
//mysql_query("UPDATE `tblemail` SET `email_body_TXT`='$email' WHERE `email_Identifier_TXT`='$status'");
//get Email info
if ($status == "A") {
$info = mysql_query("SELECT * FROM `tblemail` WHERE `email_Identifier_TXT` = 'A'");
}
elseif ($status == "R") {
$info = mysql_query("SELECT * FROM `tblemail` WHERE `email_Identifier_TXT` = 'R'");
}
elseif ($status == "H") {
$info = mysql_query("SELECT * FROM `tblemail` WHERE `email_Identifier_TXT` = 'H'");
}
elseif ($status == "P") {
$info = mysql_query("SELECT * FROM `tblemail` WHERE `email_Identifier_TXT` = 'P'");
}
echo '<table border="1" cellpadding="3" cellspacing="1">
<tr valign="top">
<td>Email</td>
</tr>
<tr valign="top">
<td>Details</td>
</tr>
<tr valign="top">
<td>Is Active</td>
</tr>
<tr valign="top">
<td></td>
</tr>';
//create the layout
?>
<tr valign="top">
<td>
<form name="editForm" method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>">
<!--enter options for status menu-->
<select name="status">
<option value="A">Approved</option>
<option value="P">Pending</option>
<option value="H">On Hold</option>
<option value="R">Rejected</option>
</select>
<textarea name="txtboxEmailBody" cols="45" rows="7"><?php print(stripslashes(mysql_result($info,0,"email_body_TXT"))) ?></textarea>
<!-- <input type="hidden" name="id" value="<?=$_REQUEST['id'];?>"> -->
<input type="submit" name="Submit2" value="Update">
</form>
</td>
</tr>
<tr valign="top">
<td>
</td>
</tr>
<?php
echo '</table>';
include 'library/closedb.php';
?>





Bookmarks