|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
This is related to php too:
$sqlQuery = "Select *, MONTHNAME('dateSigned') as month from guestbook ORDER BY name"; $result = mysql_query($sqlQuery, $db) or die("Unable to query database."); while($myrow = mysql_fetch_array($result)) { $dateSigned = $myrow["month"]; printf("Date: %sn", $dateSigned); } ?> the field dateSigned is a date field. (2000etcetcetc) so all i want to do is extract the month from this. Shouldn't It make a temporary field so all i have to do is use "month"?????????? $myrow["month"] is always empty :/ Thanks in advance! ![]() Cisk |
|
#2
|
|||
|
|||
|
You need to remove the single quotes from around dateSigned in the MONTHNAME function. When referring to a column name NEVER use quotes. Using quotes tells MySQL to perform the function on what's in the quotes, NOT on the contents of the field.
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > query is wrong? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|