Banner system skal virke med MySQL
Hej, jeg har denne kode:---------------------------------------
<%
Set topbanner = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("banner.mdb")
topbanner.CursorLocation=3
topbanner.Open DSN
arrDay = Array("Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag")
dato = date()
dag = arrDay(WeekDay(dato)-1)
'Her finder den dem som er valgt til at blive vist i dag
if session("brugernavn") = "" then
set rs = MyConn.execute("SELECT * from 468banner where dage LIKE '%," & dag &",%' and startdato <= Date() and slutdato >= Date() and starttid <= Time() and sluttid >= Time() and sideid like '%,"& side &",%'")
else
set rs = MyConn.execute("SELECT * from 468banner where dage LIKE '%," & dag &",%' and startdato <= Date() and slutdato >= Date() and starttid <= Time() and sluttid >= Time() and sideid like '%,"& side &",%' and kon like '%,"& brugerop("sex") &"%,' and alder like '%,"& brugerop("alder") &"%,'")
end if
if not rs.eof then
randomize
linie = int(rs.RecordCount * rnd)
rs.Move(linie)
if rs("telleklik") = true then
Response.Write "<a href=bannerklik.asp?t=468&id="& rs("id") &" target=_blank><img src="& rs("banner") &" border=0></a>"
else
Response.Write rs("banner")
end if
Set visbanner = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("banner.mdb")
visbanner.Open DSN
Set vis = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * from 468banner where id = "& rs("id") &""
vis.Open strSQL, visbanner, 1, 3
vis("visninger") = vis("visninger") + 1
vis.update
vis.close
else
Response.write "<p align=center>Vil du have dit banner her???<br><a href="& filnavn &"?sid=40 class=linkcontent>Så klik her!!</a></p>"
end if
rs.close
%>
---------------------------------------
Den vil jeg gerne have til at virke med MySQL.
/Peppino