|
Posted by Peter van Schie on 10/30/05 02:59
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
[Back to original message]
|