in my script the user can either add or update an entry, the add part works fine, but the update part doesent.
here is code:
$add_status = "insert into personal_notes values ('', $master_id, now(), now(),'$_POST[note]','$_POST[project_status]','$_POST[complete_bydate]','$_POST[cost]','$_POST[url]')";
//checks to see if creating or editing an entry
if ($_GET[master_id] != "") {
if ($_POST[project_status]) {
$add_status = "replace into personal_notes (master_id,date_added,date_modified,project_status) values ($master_id, now(), now(),'$_POST[project_status]')";
mysql_query($add_status) or die(mysql_error());
}
//there is one of these if statments for $_POST[note]','$_POST[project_status]','$_POST[complete_bydate]','$_POST[cost]','$_POST[url]
}
the result of this section of code is a new row with the data that is entered (meaning if there is text in the field it is in new row) but if i dont fill in a field i dont want to the column to be left blank in the new row, how can i use the value of the column from the previous entry with the same master id.
im not sure if i gave enough info but any help would be great
ps. if u need more just ask