List:General Discussion« Previous MessageNext Message »
From:toby - Date:May 21 2003 9:52am
Subject:Re: Update from table with multiple conditions.
View as plain text  
hay cab

its very much possible .......

run query -> 'select subject, OT ......'

mysql_fetch_row($qry_result);


if($fetchd_result[0] == 1)
{

run update query ...... update subjects 'Toto', so that their OT fields 
equal 1
and not 0.

}


hope this helps ....

good luck

toby




>From: Cab <cab@stripped>
>Reply-To: Cab <cab@stripped>
>To: mysql@stripped
>Subject: Update from table with multiple conditions.
>Date: Tue, 20 May 2003 14:59:29 +0000
>
>Hi there.
>
>I have data in a table, in the form of:
>
>Subject		OT	Count
>Toto		1	1
>Toto		0	2
>Titi		0	3
>Tete		0	4
>Tutu		1	5
>
>I'd like to make an update where in this particular example, 'Toto' is
>updated, so that if  'select subject, OT' returns the OT=1, that I can
>update the remaining subjects 'Toto', so that their OT fields equal 1
>and not 0.
>
>Is this possible?
>
>Cab
>
>
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    
>http://lists.mysql.com/mysql?unsub=1
>

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail

Thread
Update from table with multiple conditions.Cab21 May
Re: Update from table with multiple conditions.toby -21 May