Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display variable(changing) text on my webpage

Status
Not open for further replies.

royjacob

Programmer
Aug 19, 2003
5
CA
i want to be able to display changing text on my page. for instance, if its monday, i open a database, fetch the relevant record(in this case a long text message) and display it on my web page. if tuesday, another record and so on...

any ideas, help appreciated!
 
There are quite a few FAQs on database access and displaying data from recordsets. Check them out and then post back if you have specific questions. Also take a look at the general FAQs about how to ask good questions.
[cheers]

-pete
 
Database Setup:

ASP/SQL Statement:

To display the weekday numbers you can use this script, it will show you what WeekDay numbers represent:
Code:
<%
Response.Write &quot;Today's Day is: &quot; & Date & &quot;<br><br>&quot;
Response.Write &quot;Today's Day of the week number is: &quot; & WeekDay(Date) & &quot;<br><br>&quot;
Response.Write &quot;Today's Day of the week is: &quot; & WeekDayName(WeekDay(Date)) & &quot;<br><br>&quot;
Response.Write &quot;The year is: &quot; & year(date) & &quot;<br><br>&quot;
Response.Write &quot;The time on this server is: &quot; & time & &quot;<br><br>&quot;


For i = 1 to 7

Response.Write WeekDay(&quot;9/&quot; & i & &quot;/03&quot;) & &quot; &quot; & WeekDayName(i) & &quot;<br>&quot;

Next
%>
Then after you install mysql, and READ how you connect to the db in that tutorial, then you can just use this sql statement:

strSQL = &quot;SELECT WeekDay,WeekDayText FROM table_name WHERE WeekDay=&quot; & WeekDay(Date)

Make sure WeekDay is a numeric field, if its not then you will have to put single quotes around it.

- Good luck.
Jason



www.vzio.com
ASP WEB DEVELOPMENT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top