Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

php mysql update database what wrong with it

update
sellhead.NewCCode  = customer.id
where  AOL.sellhead inner join AOL.customer on sellhead.CCode = customer.Code
0
teera
Asked:
teera
  • 3
1 Solution
 
Raynard7Commented:
try

update sellhead, customer set sellhead.NewCCode  = customer.id where  sellhead.CCode = customer.Code
0
 
teeraAuthor Commented:
update  sellhead
set sellhead.NewCCode  = customer.id
where  AOL.sellhead inner join AOL.customer on sellhead.CCode = customer.Code
0
 
Raynard7Commented:
no,

you need to mention both tables at the beginning - then join them later

just as I gave - and as the examples in what I posted above.

so

update sellhead, customer set sellhead.NewCCode = customer.id where sellhead.CCode = customer.Code
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now