View Single Post
 
Old December 1st, 2007, 12:43 PM
scottiegirl scottiegirl is offline
Authorized User
 
Join Date: Aug 2003
Location: Schuylerville, NY, USA.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mike,

Thanks for all of your help! I am going to go to the client and ask if I can alter the layout of the home page slightly to accommodate the new coding, which, by the way, now works!

Here is the final result:
Code:
$sql = "SELECT id, first_name, last_name, company, date_format(entry_date, '%m-%d-%Y') as formatted_date, date_format(entry_date, '%M') as formatted_month FROM membership WHERE entry_date BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 2 MONTH ) AND CURDATE( ) ORDER BY entry_date, last_name";

$result2 = mysql_query($sql)
            or die(mysql_error()." - error: could not connect");

//echo $sql;
//echo "<BR>count=".mysql_num_rows($result2);

$blnWriteMonth = true;
while ($data = mysql_fetch_array($result2)) {
    if ($blnWriteMonth) {
        echo "<span class='months'>".$data['formatted_month']."</span>";
        $blnWriteMonth = false;
    }
    echo "<p class='newbies'><strong>".$data['first_name']." ".$data['last_name']."</strong><br />".$data['company']."<br />".$data['formatted_date']."</p>";
}
Hope anyone who needs this type of coding in future finds it useful!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HollyAnn
aka Scottiegirl

"I was put on Earth to accomplish a certain number of things. Right now I am so far behind, I will never die." - Calvin, Calvin and Hobbs