PHP MySQL Update query problem
Posted: Tue Jun 19, 2007 10:17 am
hi
I am working on a web page which logs incidents which may oocur at a school (such as accidents etc.) It is split over four pages, the first page's form's data is added to the table, and the user moves onto the second page.
At the second page, I wanted to be able to update the record that was previoulsy just been added. Only 1/4 of the record has data in it and the 2nd page should update the record with the additional data. Now the query I am running is:
QUERY: UPDATE incidents SET id='1',
first_name='Joe',
surname='Bloggs',
tutor='7ABC',
age='12',
sex='Male',
role='Student',
nature='broken bone',
body_part='right leg',
absence='Yes',
no_days='14',
condition='Remain at Hospital for over 24 hours',
WHERE id='1'
I am getitng a mySQL syntax error, but cant find it for the life of me! Is it becuase im not including all the fields in the database in the update, as I said this is only partial fields of the record.
Sorry for the long post. Any help is appreciated!
Thanks
Mark
I am working on a web page which logs incidents which may oocur at a school (such as accidents etc.) It is split over four pages, the first page's form's data is added to the table, and the user moves onto the second page.
At the second page, I wanted to be able to update the record that was previoulsy just been added. Only 1/4 of the record has data in it and the 2nd page should update the record with the additional data. Now the query I am running is:
QUERY: UPDATE incidents SET id='1',
first_name='Joe',
surname='Bloggs',
tutor='7ABC',
age='12',
sex='Male',
role='Student',
nature='broken bone',
body_part='right leg',
absence='Yes',
no_days='14',
condition='Remain at Hospital for over 24 hours',
WHERE id='1'
I am getitng a mySQL syntax error, but cant find it for the life of me! Is it becuase im not including all the fields in the database in the update, as I said this is only partial fields of the record.
Sorry for the long post. Any help is appreciated!
Thanks
Mark