Know anything about MySQL Queries through PHP ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlazingBucks_Ryan
    Confirmed User
    • Dec 2005
    • 203

    #1

    Know anything about MySQL Queries through PHP ?

    Ask me to do an install no problem... but I know absolutely NOTHING about programming, the last two days I have spent more time tweaking crap than I care to admit.. I think I am FINALLY starting to get the hand of basic database integration into websites through SQL Queries .. Anyways the code is below, my problem is it is displaying the date in this format 1137679440, 1137678780, 1137678240, and so on ..

    I could change the way it appears in the mysql tables but then I risk it affecting the way the rest of the script displays the date. I assume there is some way to convert the date through php code into standard XX/XX/XXXX format.. Time and date would be nice if I could get it from that also.. Any ideas? Code is below,


    Code:
    <?
    $query = "SELECT bhost_entries.e_id,bhost_entries.title,bhost_entries.date,bhost_weblogs.owner,bhost_weblogs.weblog FROM bhost_entries,bhost_weblogs WHERE bhost_entries.author_u_id = bhost_weblogs.u_id ORDER BY bhost_entries.e_id DESC LIMIT 12";
    $result = mysql_query($query);
    echo mysql_error();
    while(list($id,$title,$date,$owner,$weblog) = mysql_fetch_array($result))
    {
    echo "<TR><TD WIDTH=100><a href='http://$weblog.domainname.com/profiles/directory/' target='new'>$owner:</a></TD><TD WIDTH=400><a href='http://$weblog.domainname.com/' target='new'>$title</a> $date</TD></TR>";
    }
    ?>
    BLAZING BUCKS - Leading The Fight Against Saturation!
    1000's Of Pics For Your TGP Submissions, Pre-Built Free Sites, and Dynamically
    Changing Tours Assuring Your Traffic Is ALWAYS Converting The Best It Possibly Can!

    ICQ : 253483920 or [email protected]
  • Varius
    Confirmed User
    • Jun 2004
    • 6890

    #2
    In your query you can use the mysql function FROM_UNIXTIME() around the field in question...or on the PHP side, you can use the date() function on it to format it as you like
    Skype variuscr - Email varius AT gmail

    Comment

    • BlazingBucks_Ryan
      Confirmed User
      • Dec 2005
      • 203

      #3
      Awesome Thanks Varius !!
      BLAZING BUCKS - Leading The Fight Against Saturation!
      1000's Of Pics For Your TGP Submissions, Pre-Built Free Sites, and Dynamically
      Changing Tours Assuring Your Traffic Is ALWAYS Converting The Best It Possibly Can!

      ICQ : 253483920 or [email protected]

      Comment

      • BlazingBucks_Ryan
        Confirmed User
        • Dec 2005
        • 203

        #4
        Worked perfectly, tried to use the mysql function but I didn't like the output .. quick google showed me how to do the formatting and boom! ;)

        Thanks Again Bro !
        BLAZING BUCKS - Leading The Fight Against Saturation!
        1000's Of Pics For Your TGP Submissions, Pre-Built Free Sites, and Dynamically
        Changing Tours Assuring Your Traffic Is ALWAYS Converting The Best It Possibly Can!

        ICQ : 253483920 or [email protected]

        Comment

        Working...