hi guys.. I have this php code to insert date to the database at my registration form...
<select name="daydiv" id="daydiv" onchange="validate_date(register)">
<?php
for($d=1; $d<=31; $d++)
{
if($d<10) echo "<option value='$d'>0".$d;
else echo "<option value='$d'>".$d;
echo "</option>";
}
?>
</select>
<select name="month" id="month" onchange="dropdown(register)">
<?php
for($m=1; $m<=12; $m++)
{
if($m<10) echo "<option value='$m'>0".$m;
else echo "<option value='$m'>".$m;
echo "</option>";
}
?>
</select>
<select name="year" id="year" onchange="dropdown(register)">
<?php
for($y=1910; $y<=2010; $y++)
{
if($y<10) echo "<option value='$y'>0".$y;
else echo "<option value='$y'>".$y;
echo "</option>";
}
?>
</select>
with this sql query... (this sql query below is just the example to get the year from my D😎
<?php
$query = "SELECT * FROM `userdetail`";
$tables = mysql_query($query,$link);
$result = mysql_fetch_array($tables);
$year = $result['birthdate'];
echo substr("$year",0,4);
?>
I need to implement the sql query above to update userdetail with dropdown menu same like my registration form
So at the updateprofile form, the dropdown is selected with the year that is get from the query
Anyone can help? 😕
NB : Sorry bad english grammar ... :queasy: