sasha85
10-26-2007, 02:20 PM
that is the last time
http://www.codingforums.com/showthread.php?t=980
someone asked about this...and no one knew than...it was 2002...
now the question is:
this code works! it puts the 1 in field "online"
if i will open asp file with that code alone and i will enter this asp with session it will give me "1" perfectly!
dim mysql, connasa, connstringasa
Set connasa = Server.CreateObject("ADODB.Connection")
ConnStringasa = "Driver={MySQL ODBC 3.51 Driver};Server=mySQL4.domain.com;database=user;user=user;password=pass;OPTION=3"
Connasa.Open ConnStringasa
if Session("usernameid")<>"" then
vab=Session("usernameid")
mySQL="UPDATE crmagents SET online=1 WHERE username='" & vab & "'"
connasa.execute(mySQL)
end if
Connasa.close
but when i put the same code in the global.asa
like this
<script language="vbscript" runat="server">
Sub Session_OnStart
dim mysql, connasa, connstringasa
Set connasa = Server.CreateObject("ADODB.Connection")
ConnStringasa = "Driver={MySQL ODBC 3.51 Driver};Server=mySQL4.domain.com;database=user;user=user;password=pass;OPTION=3"
Connasa.Open ConnStringasa
if Session("usernameid")<>"" then
vab=Session("usernameid")
mySQL="UPDATE crmagents SET online=1 WHERE username='" & vab & "'"
connasa.execute(mySQL)
end if
Connasa.close
end sub
</script>
when i enter pages with the right sessions...i got nothing...just like it not works...
why? whyyyy me?:)
http://www.codingforums.com/showthread.php?t=980
someone asked about this...and no one knew than...it was 2002...
now the question is:
this code works! it puts the 1 in field "online"
if i will open asp file with that code alone and i will enter this asp with session it will give me "1" perfectly!
dim mysql, connasa, connstringasa
Set connasa = Server.CreateObject("ADODB.Connection")
ConnStringasa = "Driver={MySQL ODBC 3.51 Driver};Server=mySQL4.domain.com;database=user;user=user;password=pass;OPTION=3"
Connasa.Open ConnStringasa
if Session("usernameid")<>"" then
vab=Session("usernameid")
mySQL="UPDATE crmagents SET online=1 WHERE username='" & vab & "'"
connasa.execute(mySQL)
end if
Connasa.close
but when i put the same code in the global.asa
like this
<script language="vbscript" runat="server">
Sub Session_OnStart
dim mysql, connasa, connstringasa
Set connasa = Server.CreateObject("ADODB.Connection")
ConnStringasa = "Driver={MySQL ODBC 3.51 Driver};Server=mySQL4.domain.com;database=user;user=user;password=pass;OPTION=3"
Connasa.Open ConnStringasa
if Session("usernameid")<>"" then
vab=Session("usernameid")
mySQL="UPDATE crmagents SET online=1 WHERE username='" & vab & "'"
connasa.execute(mySQL)
end if
Connasa.close
end sub
</script>
when i enter pages with the right sessions...i got nothing...just like it not works...
why? whyyyy me?:)