http://www.mysql.com/documentation/mysql/commented/manual.php?section=Date_a
nd_time_functions
(that's all one line, of course, in case your mail client wrapped it.) (The
"%a", "%w", and "%W" format specifiers will likely be of particular
interest.)
Another way can be even more pretty : ) From MySQL Online Documentation :
DAYOFWEEK(date)
Returns the weekday index for date (1 = Sunday, 2 = Monday, ... 7 = Saturday). These index values correspond to the ODBC standard.
mysql> select DAYOFWEEK('1998-02-03');
-> 3
--
<?php
/* connection and that greasy stuff here */
$day_of_week = array(1 => "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
$sql = "SELECT DAYOFWEEK(date_field_name_here) AS DAY FROM table_name";
$result = mysql_query($sql, $conn);
$day = mysql_result($result, 0, 0);
echo "The day of the week is : " . $day_of_week[$day] . "<BR>\n";
?>
Regards,
Joao