Author |
Topic |
|
kozmos1
Starting Member
3 Posts |
Posted - 07 July 2002 : 06:23:44
|
I am working on an asp page which should display the following:
There are X posts in X topics. We have X members.
I want the generated html code of this asp page to contain only the above line and nothing else (not <html> etc, just the words above).
Now, the closest I got is the following code:
<!--#INCLUDE FILE="config.asp" --> <!--#INCLUDE FILE="inc_functions.asp" --> <!--#INCLUDE FILE="inc_top_short.asp" -->
<%
'## Forum_SQL strSql = "SELECT " & strTablePrefix & "TOTALS.P_COUNT, " &_ strTablePrefix & "TOTALS.T_COUNT, " &_ strTablePrefix & "TOTALS.U_COUNT " &_ " FROM " & strTablePrefix & "TOTALS"
Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.open strSql, my_Conn
Users = rs1("U_COUNT") Topics = rs1("T_COUNT") Posts = rs1("P_COUNT")
rs1.Close set rs1 = nothing
Response.Write(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.) %>
Unfortunately the html code it generates does not include only the statement I want, but also some other tags. Can someone help me to produce the asp code which will do what I want? Please excuse my ignorance.
Thanks! Simon
|
|
DoraMoon
Average Member
Taiwan
661 Posts |
Posted - 07 July 2002 : 07:00:01
|
quote:
Response.Write(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.) %>
i think there are some syntax error .. try this.. (add the two small " quote symbol .... )
Response.Write "(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.)" %>
~~ ¡¹ ¡¸ ¡¸¡¹ ¡¸ ¡¹ ~~ |
|
|
kozmos1
Starting Member
3 Posts |
Posted - 07 July 2002 : 07:06:46
|
quote:
[quote] Response.Write(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.) %>
i think there are some syntax error .. try this.. (add the two small " quote symbol .... )
Response.Write "(There are " & Posts & " messages in " & Topics & " topics. We have" & Users & " users.)" %>
Thanks, I missed the quotes out, but that's not the problem... Any solutions, anybody?
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 07 July 2002 : 07:30:40
|
No need to include inc_top_short.asp and inc_functions.asp there.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 07 July 2002 : 18:40:43
|
Kozmos1,
Here is your full code:
<!--#INCLUDE FILE="config.asp" -->
<%
strArchiveTablePrefix = strTablePrefix & "A_"
set my_Conn= Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString
'## Forum_SQL strSql = "SELECT " & strTablePrefix & "TOTALS.P_COUNT, " &_ strTablePrefix & "TOTALS.T_COUNT, " &_ strTablePrefix & "TOTALS.U_COUNT " &_ " FROM " & strTablePrefix & "TOTALS"
Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.open strSql, my_Conn
Users = rs1("U_COUNT") Topics = rs1("T_COUNT") Posts = rs1("P_COUNT")
rs1.Close set rs1 = nothing
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>There are " & Posts & " messages in " & Topics & " topics. We have " & Users & " users.</font>" %>
I have found that this works with bringing only the things you wanted. The code in red was missing, and the code in green has been altered a little bit. All I know is that it works.
Happy playing..
Regards,
Webmaster @ Classic Motorycling Australia Classic Motorcycling Australia |
|
|
kozmos1
Starting Member
3 Posts |
Posted - 08 July 2002 : 13:50:07
|
thanks a lot folks!
|
|
|
|
Topic |
|