SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about Month

    hi all..i have one question here...regarding with month

    I want to display a personel daily report based on Month.
    I have one selsect option for Name of Month (January, February and ....December).

    my query is:
    PHP Code:
    $sqlstmt=mysql_query("SELECT * FROM dailyreport WHERE Month(date) ='$Month' ORDER BY date"); 
    How can i returned the value name of month (January,February...) ..Because this is just display the data for 1,2....12.

    Thanks in aadvance

  2. #2
    SitePoint Enthusiast peteoc's Avatar
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you'd need to give us some more information please

    structure of the table you are pulling the data from.
    exactly what data you require
    www.totaltxt.co.uk - UK Unique Auction Site
    All advise given by myself is used at the risk of the user.
    I will take no responsibility for your databases
    being lost etc.

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    change this --

    ... WHERE Month(date) ='$Month'

    to this --

    ... WHERE Monthname(date) ='$Month'
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    change this --

    ... WHERE Month(date) ='$Month'

    to this --

    ... WHERE Monthname(date) ='$Month'
    Thanks a lot..It works


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
  •