SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: mysql to php

  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    california
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql to php

    Hi all:
    How can i add this command (SELECT DATE_FORMAT('CreateDate', '%b:%d:%Y') to the sql command below so that i can get the date fromat as month, date, year (Example : jan 23, 2004). ?


    $connection = mysql_connect($host,$user,$password)
    or die ("Couldn't connect to the service.");
    $db = mysql_select_db($database,$connection)
    or die ("couldn't connect to the server");
    $query = "SELECT * FROM eventbl ORDER BY MemID DESC ";
    $result = mysql_query($query)
    or die ("Couldn't excute query.");

    echo "<div align='center'>";
    echo "<table cellspacing='1' border='0' cellpadding = '0' width='600'>";
    echo "<Table Cellspacing = '8' border='0' cellpadding='0' width='600'>";
    echo "<tr><td colspan='2'><hr></td></tr>\n";
    while ($row = mysql_fetch_array($result))
    {
    extract($row);
    $mydate =
    $Country = strtoupper($Country);
    $Name = ucwords($Name);

    echo "<tr><td valign='top' width ='130'>$Name<br>$Country</td>\n
    <td>$CreateDate<br>$Message</td>\n
    </tr>\n";
    echo "<tr><td colspan='2'><hr></td></tr>";
    }

    echo "</table>\n";
    echo "</div>";

    thankssss

  2. #2
    Non-Member St.'s Avatar
    Join Date
    Nov 2004
    Location
    Cloud #9
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how you keep time into sql table?
    show table structure plz

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Mexico
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a Dreamweaver extension that does that job here:
    http://www.kaosweaver.com/extensions...hp?id=68&cid=5
    Alexandro Colorado


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •