Baleric
09-17-2005, 02:47 PM
hihi ppl, im having trouble adding numbers to a database,
i have a news page where i would like to have a hit counter.
And like every other hit counter i would like to add a +1 when someone comes in to view that news,
now here is my code.
<% Set cnnLogin = Server.CreateObject("ADODB.Connection")
cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
& "DBQ=" & Server.MapPath("SamDave.mdb"))
%>
<% cnnLogin.execute("UPDATE _news SET news_views = '" & 1 & "' WHERE ID = '" & request.QueryString("show") & "'") %>
i also have the database as a number instead of text, cause i was told that it should add a 1 automatically to the existing number...
appreciate any comments
thanx -baleric
i have a news page where i would like to have a hit counter.
And like every other hit counter i would like to add a +1 when someone comes in to view that news,
now here is my code.
<% Set cnnLogin = Server.CreateObject("ADODB.Connection")
cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
& "DBQ=" & Server.MapPath("SamDave.mdb"))
%>
<% cnnLogin.execute("UPDATE _news SET news_views = '" & 1 & "' WHERE ID = '" & request.QueryString("show") & "'") %>
i also have the database as a number instead of text, cause i was told that it should add a 1 automatically to the existing number...
appreciate any comments
thanx -baleric