Thanks to Hugh and DL Neil for their answers. I got it working now with
your help. Makes me feel dumb now!

-- Andrés




> 
> In your SQL request, sort by date.  When printing the output,
> keep track of the previous date - only print the date if it
> changes.  Something like
> 
>     $conn = mysql_pconnect($host, $usr, $pwd);
>     mysql_select_db("mydb");
>     $sql = "SELECT id,date,time,title,body FROM mytable ORDER 
> BY date DESC";
>     $res = mysql_query($sql);
> 
>     $date = "previous date";
>     while($row = mysql_fetch_array($res)) {
>         if ($date != $row["date"]) {
>             $date = $row["date"];
>             echo "<br>$date";
>         }
> 
>         echo "<p>".$row["time"]." ".$row["title"];
>         echo "<br>".$row["body"];
>     }
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
> 


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to