I am trying to update a row using an edit form by passing id of the row .. but it is not working .. can anybody find what went wrong ........ Code: [Select]echo '<a href="addedit.php?edit&id='.$row['id'].'" title="Edit This Member"';
echo '><img src="images/edit.png"></a>
if(isset($_GET['edit'])) { $sql="select * from news where id=$_REQUEST[id]"; $row=mysql_fetch_row(mysql_query($sql)); $action="editnews"; $news=$row[2]; $subject=$row[1]; $button='Update news'; include 'newsForm.php'; exit(); } if (isset($_POST['action']) and $_POST['action'] =='Update news')
{ $id=$_REQUEST['id']; $sql='update NEWS SET news="'.$_POST['news'].'",subject ="'.$_POST['subject'].'",added=curdate() where news.id= "$id"'; if(mysql_query($sql)) echo "Updated";