Hi all,
how can I show month from table. And I want it to be displayed as month name, like January, February, etc.
PHP Code:
<?php
//connect to database
$connect = mysql_connect(“localhost”, “root”, “”);
mysql_select_db(“probes”);
$y = 2007;
$s = 13;
$m = 12;
$d = 4;
$H = 23;
$i = 30;
mysql_query(“INSERT INTO date VALUES (‘$y-$m-$d $H:$i:$s’)”);
$query = mysql_query("SELECT * FROM date");
while ($row = mysql_fetch_array($query))
{
$date = getdate($row[‘datetime’]);
printf(‘%s %d, %d’,$date[‘month’],$date[‘mday’],$date[‘year’]);
}
$a = getdate();
printf(‘%s %d, %d’,$a[‘month’],$a[‘mday’],$a[‘year’]);
?>
When I run this code I get
Code:
Notice: A non well formed numeric value encountered in C:\wamp\www\ utorials\date\date.php on line 17 January 1, 1970
<snip/>