Re: [PHP-WIN] Need help updating a whole column in one table from another table

2009-04-15 Thread Niel Archer
> > > (got work to do during business hours) on the differences between > > > UPDATE and INSERT. > > > >INSERT creates a new entry, update changes an existing ones. So you > >cannot use INSERT to corect your data. > > Then it must work on a created field that has not been populated yet? > It doe

Re: [PHP-WIN] Need help updating a whole column in one table from another table

2009-04-15 Thread James Crow
Bill Mudry wrote: The following SQL query UPDATE species2 AS s LEFT JOIN sci_genera AS sg ON (sg.genus_name = LEFT(s.species_name, LOCATE(' ', s.species_name) - 1)) SET s.generalID = sg.generalID; alters the contents of species2 to become ID species_name 1 Quercus rubra 2 Dalbergia

Re: [PHP-WIN] Need help updating a whole column in one table from another table

2009-04-14 Thread Bill Mudry
The following SQL query UPDATE species2 AS s LEFT JOIN sci_genera AS sg ON (sg.genus_name = LEFT(s.species_name, LOCATE(' ', s.species_name) - 1)) SET s.generalID = sg.generalID; alters the contents of species2 to become ID species_name 1 Quercus rubra 2 Dalbergia nigra Assuming I

Re: [PHP-WIN] Need help updating a whole column in one table from another table

2009-04-14 Thread Bill Mudry
At 02:37 PM 4/14/2009, you wrote: > (got work to do during business hours) on the differences between > UPDATE and INSERT. INSERT creates a new entry, update changes an existing ones. So you cannot use INSERT to corect your data. Then it must work on a created field that has not been populated

Re: [PHP-WIN] Need help updating a whole column in one table from another table

2009-04-14 Thread Niel Archer
> At 10:40 AM 4/14/2009, you wrote: > > > In the botanical tree of woods, I got the original code for working > > > ok a few days ago but there are so > > > many errors in the Species MySQL file that there is a lot of cleanup > > > in the data needed before the > > > whole tree will work well. > >

Re: [PHP-WIN] Need help updating a whole column in one table from another table

2009-04-14 Thread Bill Mudry
At 10:40 AM 4/14/2009, you wrote: > In the botanical tree of woods, I got the original code for working > ok a few days ago but there are so > many errors in the Species MySQL file that there is a lot of cleanup > in the data needed before the > whole tree will work well. > > In particular, there

Re: [PHP-WIN] Need help updating a whole column in one table from another table

2009-04-14 Thread Niel Archer
> In the botanical tree of woods, I got the original code for working > ok a few days ago but there are so > many errors in the Species MySQL file that there is a lot of cleanup > in the data needed before the > whole tree will work well. > > In particular, there are two files of interest that w