[thelist] mySQL- how to test if table contains data

Richard Bennett richard.bennett at skynet.be
Wed Feb 6 08:02:03 CST 2002


Hi,
Thanks for the advice.
I managed to cut the response time by about half by doing it like this, but
I think I'll be better building an index-table which is updated when the
records are added, containing just the date of the days containing data.
The GROUP BY doesn't work in this case, as TIME is a UNIX time-stamp, so
there are no identical ones.
Would it be possible to "GROUP BY " day, when the date-format is in
Unix-time (sec since 1970) ?

Thanks again,
Richard.

----- Original Message -----
From: "BT Bigpant" <bigpant at btinternet.com>

Sorry, that should have been

$sql = "SELECT date FROM $database.$timetable WHERE Truckip like '$truckip'
AND TIME<=$timeto AND TIME>=$timefrom GROUP BY TIME ORDER BY TIME;";






More information about the thelist mailing list