HI,
I have a mySQL database with a table called classes. One of the
fields is "time" type="time". I have an asp page that calls for
classes listed in the class database depending on day and time. I
have a table with two columns. The first column has the first
three cllasses that occur after the current time and the second colum
is the next three classes. It will pull the first three classes
but instead of time it gives the current date which is not entered
anywhere in the database. Below is my code. I would
appreciate any help.
<%
Dim TodayDay, NowTime, lastTime, id
TodayDay = WeekDayName(WeekDay(date()), false, 1)
rs.Open "SELECT * FROM classes WHERE classes.day='"
& TodayDay & "' AND classes.time >= CURRENT_TIME() ORDER BY
classes.time LIMIT 3", conDB
%>
<tr>
<td width="49%" valign="top" class="bodyTxt">
<%
count = 1
DO WHILE NOT rs.EOF
if NOT rs.EOF THEN
if count = 3 THEN
lastTime =
rs("time")
id = rs("classID")
ELSE
END if
response.Write("<span
class='headBox'> " & rs("className") & ": </span> "
& rs("time") & "<br>")
Else
END if
count = count + 1
rs.MoveNext
Loop
rs.Close
%>
</td>
<td width="2%"> </td>
<td width="49%" valign="top" class="bodyTxt">
<%
rs.Open
"SELECT * FROM classes WHERE classes.day='" & TodayDay & "'
ORDER BY classes.classID LIMIT 4", conDB
DO WHILE rs.EOF
if NOT rs("time") >= lastTime AND rs("classID")
<> id THEN
response.Write("<span
class='headBox'> " & rs("className") & ": </span> "
& rs("time") & "<br>")
Else
END if
rs.MoveNext
Loop
rs.Close
%>
</td>
</tr>
Thanks,
judo2000
------------- If you are not willing to work hard to realize your dreams, why bother dreaming?
|