var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Updating a row with the right connections
I have a database with two tables:
The Appointments table stores date/time for an appointment as well as the 'member' (or customer) that is attending it.
The Notes table stores the notes entered after an appointment and is linked to the Appointment table by an 'appointment' field. There is also a 'new' field to show if the Notes have been read or not.
I need to be able to set the 'new' fields in Notes to 0 for all appointments that relate to, say, member 6.
I'm sure its a simple SQL process, but I don't know it.
UPDATE Notes, Appointments SET Notes.new=0 WHERE Appointments.member=6 AND Notes.appointment=Appointments.ref
But it doesn't like this.
What is the correct format?
If your update statement has the correct columns it should read:
FROM Notes, Appointments
Brilliant - thats exactly what I was looking for.
Never used a 'FROM' in an UPDATE statement before - you learn something new every day.