Re: while loop
| From: | Burhan Khalid | Date: | Wed, 23 Feb 2005 12:42:17 +0000 |
| Subject: | Re: while loop | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209231@lists.php.net to get a copy of this message | ||
Reinhart Viane wrote:
Hey list I have a mysql table like this: [ snipped ]
Now I retrieve all activities happening in the future with this query: $sqlact="select * from activities where act_date >= NOW() order by act_type_id”; $getact=mysql_query($sqlact) What I’m trying to do now is: From the result array, pick from every different act_type_id the two activities that will happen first and put them in 2 variableswhile($row = mysql_fetch_assoc($getact)) { $results[$row['act_type_id']][] = $row; } echo "<pre>"; print_r($results); echo "</pre>"; Please send only plain text messages to the list, and avoid attachments.