• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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’


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.