richcleverley
MIS
Hi,
I have a table, that when new information is entered for it the new info is held in a temporary table that has exactly the same fields (the only difference is the auto increment pid in the original table is not auto increment in the temporary one - it holds the pid from the original).
I need to be able to update the original with the contents of the temporary field, all fields are updated.
Is there an easy way to do this, or will I need to select from the temporary and then run the update setting all the fields explicitly.
I have tried something like
I have a table, that when new information is entered for it the new info is held in a temporary table that has exactly the same fields (the only difference is the auto increment pid in the original table is not auto increment in the temporary one - it holds the pid from the original).
I need to be able to update the original with the contents of the temporary field, all fields are updated.
Is there an easy way to do this, or will I need to select from the temporary and then run the update setting all the fields explicitly.
I have tried something like
Code:
Update villas SELECT * FROM updatevilla WHERE pid='$villapid'
[/code ] in php but it doesn't work. I think I see what some of the problem is but am not sure how to fully write the query.
Thanks
Richard