OK, I need some help with this one. I hate admitting defeat but I'm getting frustrated!
I've got a table called 'Events' with these fields...
eID
eName
eStartDate
eEndDate
An example entry would be...
1
'Course Open Day'
12-Nov-2006
14-Nov-2006
What I want to be able to do is search the table and select any records where a given date falls between the the startDate and endDate.
So, if I searched with '13-Nov-2006' i'd get 'Course Open Day'.
Hope I've made myself clear!
Thanks, Andy.
Page 1 of 1
SQL & Date Range(s)
#2
Posted 15 October 2006 - 07:47 PM
<?php
$query = "SELECT eID, eName, eStartDate, eEndDate FROM events";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
echo "Name :{$row['eName']} <p />" .
"Start Date : {$row['eStartDate']} <p />" .
"End Date : {$row['eEndDate']} <p />";
}
?>
$query = "SELECT eID, eName, eStartDate, eEndDate FROM events";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
echo "Name :{$row['eName']} <p />" .
"Start Date : {$row['eStartDate']} <p />" .
"End Date : {$row['eEndDate']} <p />";
}
?>
#4
Posted 15 October 2006 - 08:55 PM
Ah Gotcha!
Sorry
Ermmmm, gotcha, ok, does this link help at all?
http://www.help.thinkhost.com/web-developm...-forms_359.html
Ben
Sorry
Ermmmm, gotcha, ok, does this link help at all?
http://www.help.thinkhost.com/web-developm...-forms_359.html
Ben
#5
Posted 16 October 2006 - 07:49 AM
Not really
, but thanks for the link - looks like a good reference page!
I might have to give in and do it another way
I might have to give in and do it another way
Share this topic:
Page 1 of 1
Help

















