sweenster
11-08-2002, 06:12 PM
i have the following block of php code to read and extract all databse entries marked with todays date on them:
$thedate = date("Ymd");
$query = "SELECT *,DATE_FORMAT(date,'%Y%m%d') AS fdate, FROM stats";
if ($mysql_result = mysql_query($query, $linkdb)) {
if (ExecuteQuery($linkdb, $result, $query)) {
while ($row = NextRow($result)) {
if ($row['fdate'] == $thedate) {
#print out the record etc.
}
}
}
}
i'm looking for a way i can do this in one go in the SQL query string, without having to go through all of them.
the field 'date' is a 14digit timestamp.
$thedate = date("Ymd");
$query = "SELECT *,DATE_FORMAT(date,'%Y%m%d') AS fdate, FROM stats";
if ($mysql_result = mysql_query($query, $linkdb)) {
if (ExecuteQuery($linkdb, $result, $query)) {
while ($row = NextRow($result)) {
if ($row['fdate'] == $thedate) {
#print out the record etc.
}
}
}
}
i'm looking for a way i can do this in one go in the SQL query string, without having to go through all of them.
the field 'date' is a 14digit timestamp.