Welcome Guest, Not a member yet? Register   Sign In
Need Help
#1

[eluser]nandish[/eluser]
Hi guys

Want to update two tables in mysql using single query.

update tbl1,tbl2 set tbl1.field ='aaa',set tbl2='bbb' where tbl.field ='ccc' AND tb2.field ='ccc'

I used above format but its giving error.

Thanks
#2

[eluser]Nikhil Vijayan[/eluser]
The query doesn't make sense where does tbl and tb come from there is only tbl1 and tbl2

or is it typo mistake .. whetever correct one is

Quote:update tbl1,tbl2 set tbl1.field =’aaa’,tbl2.field=’bbb’ where tbl1.field =’ccc’ AND tbl2.field =’ccc’

if it doesn't work try this

Quote:update tbl1,tbl2 set tbl1.field =’aaa’,tbl2.field=’bbb’ where tbl1.field = tbl2.field AND tbl1.field =’ccc’




Theme © iAndrew 2016 - Forum software by © MyBB