Re: rows by day

From: Date: Mon, 16 Jun 2003 03:27:42 +0000
Subject: Re: rows by day
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-151621@lists.php.net to get a copy of this message
the database has the timestamp in unix format, so this is what i use for 'dayofweek_column' ? what should $old_dayofweek hold? thankyou. cheers, - Sebastian ----- Original Message ----- From: "John W. Holmes" <holmes072000@charter.net> | John W. Holmes: | | You only need one query. One of your columns should be what you want to | "change" on, like DAYOFWEEK(date_column). As you loop through your rows, | you echo out your "heading" whenever this column changes... | | while($row = mysql_fetch_assoc($result)) | { | if($row['dayofweek_column'] != $old_dayofweek) | { | echo "<tr><th>{$row['dayofweek_column']}'s Columns</th></tr>"; | $old_dayofweek = $row['dayofweek_column']; | } | echo "$row[title] <br/> Written by $row[author] <br/> $row[text]"; | } | | Untested, but something like that. :) | | ---John Holmes... |

« previous php.general (#151621) next »