You are here: Re: Need expert assistance with this (MySQL routine) « All PHP « IT news, forums, messages
Re: Need expert assistance with this (MySQL routine)

Posted by giancarlodirisioster on 10/30/05 04:48

It's working now, thank you so much. Great code. ~Carly

Peter van Schie wrote:
> giancarlodirisioster@gmail.com wrote:
>
> > Hmm, now after changing that now I get parse error, unexpected '}' in
> > /usr/home/test.php on line 15
>
> Weird. Do you have this right now? :
>
> $query = "SELECT table.column1 FROM table";
> $result = mysql_query($query);
> while($column = mysql_fetch_array($result))
> {
> $column1 = $column['column1'];
> $update = "UPDATE test SET column2 = ''
> WHERE column2 = '$column1'";
> mysql_query($update);
> }
>
> > Definitely, I have a customer and customer1 table (I know, for
> > consistency I should have customer1 and customer2), but I definitely
> > have two separate tables
>
> I did a little test for you with a customer table and a customer1 table,
> looking like this:
>
> customer:
> id name
> =============
> 1 john
>
> customer1:
> id name
> =============
> 1 pete
> 2 john
> 3 ruben
>
> I used the following query:
> DELETE customer1 from customer1,customer WHERE customer1.name=customer.name;
>
> This deletes the row with id=2 and name=john from the table customer1.
>
> --
> http://www.phpforums.nl

 

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

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