Hi Friends,
Kindly help
i am using list menu i.e day month year
i can get the data using the echo,
and how do i insert the data into MySQL
in DAY-MONTH-YEAR
for example: i want to insert
10-MAY-2010
Regards
Sachin
Hi Friends,
Kindly help
i am using list menu i.e day month year
i can get the data using the echo,
and how do i insert the data into MySQL
in DAY-MONTH-YEAR
for example: i want to insert
10-MAY-2010
Regards
Sachin
Jump to PostHtml:
<form method="post" .... <select name="day"> <option="1">1</option> ... </select> <select name="month"> <option="MAY">MAY</option> ... </select> <select name="year"> <option="2010">2010</option> ... </select> <input type="submit" /> </form>
PHP:
<?php if ($_POST) { $query="INSERT INTO [I]tablename[/I] `date` VALUES ('{$_POST['day']}-{$_POST['month']}-{$_POST['year']}')"; $result=mysql_query($query); } ?>
Html:
<form method="post" ....
<select name="day">
<option="1">1</option>
...
</select>
<select name="month">
<option="MAY">MAY</option>
...
</select>
<select name="year">
<option="2010">2010</option>
...
</select>
<input type="submit" />
</form>
PHP:
<?php
if ($_POST)
{ $query="INSERT INTO [I]tablename[/I] `date` VALUES ('{$_POST['day']}-{$_POST['month']}-{$_POST['year']}')";
$result=mysql_query($query);
}
?>
Thanks a lot , i was able to use and complete my coding.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.