Hi newbie here,
I want to add a fixture date to my database. I have a form and one area in particular is to set the date of a fixture:
<div class="row"> <span class="label">Fixture Date:
</span><span class="formw">
<select name="day">
<?
for ($i=1; $i<=31; $i++) {
echo "
<option ";
if ($i==$day) echo " selected ";echo "value='$i'>$i."; }
?>
</select>
<select name="month">
<?
for ($i=1; $i<=12; $i++) {
echo "<option ";
if ($i==$month) echo " selected ";echo "value='$i'>$i."; }
?>
</select>
<select name="year">
<?
for ($i=1; $i<=2; $i++) {
echo "
<option ";
$year = $year-1+$i;
if ($i==$year) echo " selected ";echo "value='$year'>$year"; }
?>
</select>
</span></div>
What I need is to be able to join the three bits on info to submit the data into a single field in my database using default (0000-00-00). I've tried the following but this doesn't seem to have the desired effect:
$DATE = $_POST['year'].'-'.$_POST['day'].'-'.$_POST['month'];
otherwise if anybody as a better way of doing this then please let me know. The section of my site I'm trying to get databased driven is here: http://www.thehurricanesft.co.uk/fixtures.php
thanks,
darren