Re: Re: ARRAY, IF & INSERT

From: Date: Mon, 24 Jun 2002 07:17:08 +0000
Subject: Re: Re: ARRAY, IF & INSERT
References: 1 2  Groups: php.db php.general 
Request: Send a blank email to php-db+get-20027@lists.php.net to get a copy of this message
César aracena wrote:
The catch would be to make PHP to auto assign the relatives "level" by knowing it has to start from $i=1 and loop $i++ until no other kid is inserted. Now that I write it, it seems I could use a for loop, but what should be the structure of it using the $name <> 0 you told me?
the name <> 0 was a sql-query - it will return a ressource which will enable you to make something like $i=0; while($row = mysql_fetch_assoc($nameless_result){ #psuedo-code# # mysql_query=("insert into table set relativenumber = 'jr$i' where ID=$row["ID"]"); } regards Jesper Brunholm btw: please do not write to my private email -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk

« previous php.db (#20027) next »