Jump to content

jetpackmac

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jetpackmac's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Everyone! I have a page where I'm using PHP to include some entries from a MySQL db. All the entries have a date field and I'm using the date field to display them in ascending order. What i'm trying to figure out is, how to display the MySQL entries starting from the current date to about 3 or 4 months in the future. All the other entries in the database wouldn't be displayed... Here's some code: [!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]---------------- Calling the database---------------- <?php require_once('../Connections/GetFestDir.php'); ?> <?php mysql_select_db($database_GetFestDir, $GetFestDir); $query_GetFestDead = "SELECT *, DATE_FORMAT(deadline,'%b/%d') AS newDead FROM festdir ORDER BY `feststart` ASC"; $GetFestDead = mysql_query($query_GetFestDead, $GetFestDir) or die(mysql_error()); $row_GetFestDead = mysql_fetch_assoc($GetFestDead); $totalRows_GetFestDead = mysql_num_rows($GetFestDead); ?> ---------------- Displaying the Entries --------------- <div style="width: 140px; height: 260px; overflow: auto"> <table width="120" align="left"> <?php do { ?> <tr> <td><h2 align="left"><strong><?php echo $row_GetFestDead['newDead']; ?></strong><br> <a href="<?php echo $row_GetFestDead['link']; ?>" class="orange" target="_blank"><?php echo $row_GetFestDead['name']; ?></a> </h2></td> </tr> <?php } while ($row_GetFestDead = mysql_fetch_assoc($GetFestDead)); ?> </table> </div> --------------------------------------------------------[!--colorc--][/span][!--/colorc--] Any thoughts? Thanks a ton! -JPM
  2. [!--sizeo:6--][span style=\"font-size:24pt;line-height:100%\"][!--/sizeo--][!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]YOU ROCK![!--colorc--][/span][!--/colorc--][!--sizec--][/span][!--/sizec--] Thanks so much!
  3. Hey everyone! I have a MySQL database setup on my webserver and I am displaying the contents of that db on a webpage. I have a date column in the db... of course it displays the date as yyyy/mm/dd. I am trying to change the display on my webpage to look like mm/dd/yyyy. Does anyone know how to do this? I looked up the DATE_FORMAT() function but I dont think I was using it right... I setup a record set to retrieve the db: [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?php require_once('../Connections/GetFestDir.php'); ?> <?php mysql_select_db($database_GetFestDir, $GetFestDir); $query_rsGetFestDir = "SELECT * FROM festdir ORDER BY `feststart` ASC"; $rsGetFestDir = mysql_query($query_rsGetFestDir, $GetFestDir) or die(mysql_error()); $row_rsGetFestDir = mysql_fetch_assoc($rsGetFestDir); $totalRows_rsGetFestDir = mysql_num_rows($rsGetFestDir); ?>[!--colorc--][/span][!--/colorc--] Then I use php to display the date like this: [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?php echo $row_GetFestDead['deadline']; ?>[!--colorc--][/span][!--/colorc--] So do I change the date format when I retrieve the db (in the SELECT area)? or do I change it in the php that displays it? Any help is really appreciated! Thanks!
×
×
  • 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.