I am writing a php page using php 4.3.4 and mysql-4.0.16.
Here is my code:
I can get the month out by doing
so the problem is where i say
Is there a way of selecting the DAY part of the date?
From the docs it looks as though just the MONTH and YEAR can be got this way.
------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla
roycrom
Here is my code:
Code:
if (ISSET($THEDAY)) {
echo "You have chosen the date $THEDAY/$THEMONTH/$THEYEAR";
} else {
$result = mysql_query("SELECT DAY(Date) FROM database WHERE YEAR(Date)='$THEYEAR' AND MONTH(Date)='$THEMONTH'"); ?>
<FORM METHOD=GET>
<SELECT NAME="THEDAY"> <?
while ( $row = mysql_fetch_array($result)) {
echo "<OPTION>$row[0]</OPTION>";
} ?>
</SELECT>
<INPUT TYPE=HIDDEN VALUE="<? echo $THEYEAR; ?>" NAME="THEYEAR">
<INPUT TYPE=HIDDEN VALUE="<? echo $THEMONTH; ?>" NAME="THEMONTH">
<INPUT TYPE=SUBMIT VALUE="GO">
</FORM> <?
}
I can get the month out by doing
Code:
SELECT MONTH(Date) FROM database WHERE YEAR(Date)='$THEYEAR';
Code:
SELECT DAY(Date)"
Is there a way of selecting the DAY part of the date?
From the docs it looks as though just the MONTH and YEAR can be got this way.
------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla
roycrom