Re: need help to build a query

From: Date: Tue, 10 Oct 2006 19:25:15 +0000
Subject: Re: need help to build a query
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-242931@lists.php.net to get a copy of this message
On Mon, October 9, 2006 3:09 pm, afan@afan.net wrote: > But, in this case I will have repeating order_date and order_status > info? > > id order_date status file_name > 12 2006-10-09 live file1.jpg > 12 2006-10-09 live file2.jpg > 12 2006-10-09 live file3.jpg > 13 2006-10-09 live file1.jpg > 14 2006-10-09 live test.gif Yes. But what you print out and what you have in each result row need not be exactly one-to-one. $last_order_id = ''; while (... mysql_fetch_row($result)){ if ($last_order_id != $order_id){ echo "$order_id $order_date $status<br />\n"; $last_order_id = $order_id; } echo " $file_name<br />\n"; } Here we only print out the order_id etc when the order_id changes, not for every uploaded file. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#242931) next »