I need some code that will give me something similar to this:
Monday April 10,2006 x x x
Sunday April 9,2006 x x x x
My db is set up using the sql timestamp so I need some help in how i would go about doing this.
SELECT colnames FROM tablename WHERE timestampcol BETWEEN timestamp1 AND timestamp2;
wouldn't this result in getting results from only inbetween 2 specific dates. I want it so that each different day is formatted.
Did you try laserlight's code!
SELECT datecolumn, othercolumn FROM table ORDER BY datecolumn .... $lastdate = 0; while ($row = mysql_fetch_array()) { $thisdate = $row['datecolumn']; if ($thisdate != $lastdate) { $lastdate=$thisdate; echo $thisdate."<br>"; } else { echo $row['othercolumn']."<br>"; } }
OK I think I see what you are wanting to do, so try this code to do what you want.
//Monday April 10,2006 your example date $testdate="2006/4/10"; $mydate = date('l F j, Y',strtotime($testdate)); echo $mydate;
Tha should do what you want.
K i found a good example of a site using something similar to what i want. http://www.wimp.com/ I want it to be seperated by the date posted but instead of saying the date next to each individual result i want the date posted at the top and then all the results for that date to be below it.