Hi,

Asked this on the mySQL list but it seems to be more of a PHP syntax thing
that a mySQL thing.

In have the following line in PHP

<?php $today = getdate();?>

I have a mySQL table which contains dates formatted as dates(xxxx-xx-xx)

I want to select all records based on a specific month.

This is my select statement

SELECT *
FROM sti_tracking
WHERE `date`  =  MONTHNAME('$today') = 'August'


Cased in php  it looks like so...

<?php
mysql_select_db($database_sti_tracking_DB, $sti_tracking_DB);
$query_totalHitsMonth_RS_RS = "SELECT * FROM sti_tracking WHERE `date`  =
MONTHNAME('$today') = 'August'";
$totalHitsMonth_RS_RS = mysql_query($query_totalHitsMonth_RS_RS,
$sti_tracking_DB) or die(mysql_error());
$row_totalHitsMonth_RS_RS = mysql_fetch_assoc($totalHitsMonth_RS_RS);
$totalRows_totalHitsMonth_RS_RS = mysql_num_rows($totalHitsMonth_RS_RS);
?>

but this isn't working....it's returning no records which is wrong.

Anyone see a problem?

Thx


Tim Winters
Manager, Creative Development
Sampling Technologies Incorporated (STI)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
W: 902 450 5500
C:  902 430 8498

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to