How do I update a single row without needing to update the whole record?
For instance say I just wanted to update the surname
but keep the name and email address
In the past when I have tried to do this I have emptied the complete record on update.
So what I have done to combat this is to extract the contents of the database of the database and assign these to variables and then update the record like this
$ud_name = $row['name'];
$ud_surname = $row['surname'];
$ud_email_address = $row['email_address'];
$ud_id = $row['id'];
$query = "UPDATE test SET name ='$ud_name', surname='$ud_surname', email_address='$ud_email_address WHERE id='$ud_id'";
This is fine for tables that only have 3-4 fields. There must be an easier way?