You are here: Re: FormatDateTime in PHP « PHP Programming Language « IT news, forums, messages
Re: FormatDateTime in PHP

Posted by Justin Koivisto on 10/08/84 11:36

John K wrote:
> This is how I'm trying to do this at the moment, I should have included
> this first, sorry.
>
> <?php require_once('Connections/hthConnect.php'); ?>
> <?php
> mysql_select_db($database_hthConnect, $hthConnect);
> $query_gigRecall = "SELECT tbl_gigs.fld_gig_Date,
> tbl_gigs.fld_gig_Time, tbl_gigs.fld_gig_Title, tbl_gigs.fld_gig_Place
> FROM tbl_gigs WHERE tbl_gigs.fld_gig_Date >= CURDATE()";
> $gigRecall = mysql_query($query_gigRecall, $hthConnect) or
> die(mysql_error());
> $row_gigRecall = mysql_fetch_assoc($gigRecall);
> $totalRows_gigRecall = mysql_num_rows($gigRecall);
> ?>
> <span class="midYellowCaps"><?php echo $row_gigRecall['fld_gig_Title'];
> ?></span><br>
> HERE WHERE I'M TRYING TO FORMAT THE DATE BELOW
> <?php echo $row_gigRecall['fld_gig_Date']; ?> at <?php echo
> $row_gigRecall['fld_gig_Time']; ?>

Why not just retrieve the date in that format with the query?
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

SELECT

DATE_FORMAT('%M %e, %Y',tbl_gigs.fld_gig_Date) as fld_gig_Date,

tbl_gigs.fld_gig_Time, tbl_gigs.fld_gig_Title, tbl_gigs.fld_gig_Place
FROM tbl_gigs WHERE tbl_gigs.fld_gig_Date >= CURDATE()

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация