hi
I need to display date which is stored in database and need to format and display on web page the current format is (Y-m-d)
I need to display as (d-m-Y);
On the web page pls anybody help me with the php script I will paste my code:
<?php
$d=$_POST['sdd'];
$m=$_POST['sdm'];
$y=$_POST['sdy'];
$string=date("Y/m/d",mktime(0,0,0,$m,$d,$y));
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('UNABLE TO CONNECT TO DATABASE'.mysql_error());
}
mysql_select_db("dummy");
//echo $string;
mysql_query("insert into date1 (datevalue, count) values ('$string' , ' ')");
$result=mysql_query("select date_format( datevalue , ' %d/ %m/ %Y ' ) as date from date1 order by count desc");
if($row=mysql_fetch_array($result))
{
echo "Welcome user u selected the following date";
echo "<br>";
echo $row['datevalue'];
echo "<br>";
echo "Done displaying date";
}
mysql_close($con);
?>
but it isnt displaying anything