You are here: Re: Thanks! That did it! « PHP SQL « IT news, forums, messages
Re: Thanks! That did it!

Posted by jc-Atl on 10/09/30 11:28

Thanks once again.
I also forgot to let everyone kind enough to answer know that I was indeed
talking about MySQL.
Thanks -- you were a huge help!
JC

"Hilarion" <hilarion@SPAM.op.SMIECI.pl> wrote in message
news:dhtij1$e8h$1@news.onet.pl...
> > > > I'm trying to update the recruiterDB_extraNotes.recruiter_id to set
it
> > > > equal to the corresponding value in recruiterDB_candidates. But I
keep
> > > > getting errors when I try this in phpMyAdmin. Can anyone help ?
> > > >
> > > > UPDATE `recruiterDB_extraNotes` SET
> > > > `recruiterDB_extraNotes`.`recruiter_id`
> > > > = `recruiterDB_candidates`.`recruiter_id` WHERE
> > > > `recruiterDB_extraNotes`.`candidate_id` =
> > > > `recruiterDB_candidates`.`candidate_id`
> > >
> > >
> > > What DBMS are you using? MySQL? It should work for MySQL 4.0.4 or
newer:
> > >
> > > UPDATE recruiterDB_extraNotes, recruiterDB_candidates
> > > SET recruiterDB_extraNotes.recruiter_id =
> > > recruiterDB_candidates.recruiter_id
> > > WHERE recruiterDB_extraNotes.candidate_id =
> > > recruiterDB_candidates.candidate_id
> >
> > Thanks! That did it! I was leaving out the "recruiterDB_candidates" in
the
> > UPDATE part of the statement.
> > But why do I have to include it, since I was only updating
> > recruiterDB_extraNotes ?
>
> You have to specify a list of tables including the tables which are
updated,
> but also the tables which are the source of data. Something like "FROM"
clause
> in "SELECT" statement. Different DBMSes do it different way (different
> syntax and restrictions). MySQL has it this way.
>
>
> Hilarion

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация