View Single Post
Old 05-14-2008, 01:45 AM   #1 (permalink)
sarmenhb
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default mysql update statement

hello, for some reason the update statement doesnt work for me. here is what my code looks like
thanks
Code:
<?php


include("config.php");
$viewrec = mysql_query("select * from tbl_clone where id = '$id'");
if(isset($_POST['submit'])) {

#==================
# update record
#==================


$updatesql = "update tbl_clone set 

domain = '{$_POST['txt_domain']} ' ,
client ='{$_POST['txt_client']}' , 
date_prom ='{$_POST['txt_datepromised']}' ,
status = '{$_POST['drop_status']}' ,
devsite = '{$_POST['txt_devsite']}' ,
clone_ready = '{$_POST['readyclone']}' , 
exist_customization = '{$_POST['customexist']}' , 
new_custom = '{$_POST['customaddons']}' ,
sugar = '{$_POST['txt_sugar']}' ,
comments = '{$_POST['txt_comments']}' ,
highlight = '{$_POST['highlights']}' where id='$id' ";

$updatedata = mysql_query($updatesql) or die(mysql_error());

echo "<script>alert('data updated');</script>";


}

?>


<html xmlns="http:www.w3.org1999xhtml">

<head>
<meta http-equiv="Content-Type" content="texthtml; charset=utf-8" >
<title>New Record</title>

<link href="style.css" type="text/css" rel="stylesheet"> 

<style type="text/css">
.style1 {
	color: #FF0000;
}
.style2 {
	text-decoration: none;
}
</style>
</head>

<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<div id="header">Clone/Upgrade Statuses</div>
<p>
<br>
Field Highlight:<br>
<select name="highlight">
<option value="notset">Status Not Set</option>
<option value="qc">Sitecheck/QC</option>
<option value="bug">Bug Fixing</option>
<option value="ready">Ready for delivery</option>
</select>
<br><br>
Domain:<br>
<?php

while($row = mysql_fetch_assoc($viewrec)) {



?>

<input type="text" name="txt_domain" value="<?php echo $row['domain']; ?>"> <span class="style1"><strong>(required)</strong></span><br >
<br >


Client Name:<br>
<input type="text" name="txt_client" value="<?php echo $row['client']; ?>"><br >
<br >
&nbsp;Delivery Date:<br>
<input type="text" name="txt_datepromised" value="<?php echo $row['date_prom']; ?>"> <br >
<br>


Status:<br>
<input type="text" name="drop_status" value="<?php echo $row['status']; ?>" ><br >
<br >


Dev Site<br>
<input type="text" name="txt_devsite" value="<?php echo $row['devsite']; ?>"><br >
<br >

Ready to CloneUpgrade?<br>
<input type="text" name="readyclone" value="<?php echo $row['clone_ready']; ?>">
 <br >
<br >

Customizations Existing<br>
<textarea style="width: 229px; height: 46px" name="customexist"><?php echo $row['exist_customization']; ?></textarea> <br >
<br >

Customizations (add-ons)<br>
<textarea style="width: 229px; height: 50px" name="customaddons"><?php echo $row['new_custom']; ?></textarea><br >
<br >
User:<br>
<input type="text" name="txt_sugar" value="<?php echo $row['sugar']; ?>"> <br >
<br >

Comments<br>
<textarea style="width: 232px; height: 52px" name="txt_comments"><?php echo $row['comments']; ?></textarea> <br >
<br >
<?php } ?>
<input type="submit" name="submit" value="Save Record">

</p>
</form>


<br>
<a href="index.php" class="style2">home</a>


</body>

</html>
__________________
no signature set
sarmenhb is offline  
Reply With Quote