Jump to content

date format works on one page not the other?


mullberrymae

Recommended Posts

Thanks for responding.

 

when I echo $posdate I get a date like this: 2011-04-14

 

I just want to format that to m d y

 

$sqlgb ="SELECT * FROM `guestbook`, `obituaries` WHERE  guestbook.obits_id = '$id' ";

 

$results=mysql_query($sqlgb) or die("Error: ". mysql_error(). " with query ". $sqlgb);

 

$num = mysql_num_rows($results);

 

if ($num > 0 ) {

$i=0;

while ($i < $num) {

$id = mysql_result($results,$i,"id");

$obits_id = mysql_result($results, $i, "obits_id");

$name = mysql_result($results,$i,"name");

$email = mysql_result($results,$i,"email");

$message = mysql_result($results, $i, "message");

$postdate = mysql_result($results,$i,"postdate");

 

$date = date('m d,Y', "$postdate");

 

thats the code block I'm using

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.