post icon

Update MySQL data from two tables

update node_revisions one, content_news_image two
set one.image = two.image_value
where one.nid = two.nid


Ex 2

update tbl_news one, term_node two
set one.description = two.description
where one.vid = two.vid

tbl_news – name of the table to be updated
term_node – name of table which hold data
one.description – name of the field where data is going (being updated)
two.description – name of the field FROM where data is hold



Comments are closed.

Leave a comment