Copy link to clipboard
Copied
Hi
Just a little problem:
I have the following query:
SELECT MONTHNAME(year) AS Month
FROM features1
which return the Month as JANUARY
I would like to get a shorter version of the month ie JAN
any ideas?
Copy link to clipboard
Copied
Think I just figured it out:
SELECT LEFT(MONTHNAME(year),3) AS Month,
FROM features1
Using LEFT: Returns the leftmost number of characters as specified by the amount (in this case 3)
Woot
Copy link to clipboard
Copied
echo substr($query_row['Month'], 0, 3);