Hi...
I am trying to convert a simple FAQ script to access mysql db rather than
the Access db it was designed for. The originators of the script offer no
support at all.
I have managed to set up the mysql db and have frigged the script to get it
running, however certain bits are not functional, i.e. the links on the
categories.
This is where I am so far
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim Conn
Dim RSBODY
Dim CatName
Dim RS
Dim SQLBODY
Dim SQLCat
Server.ScriptTimeout = 10000000
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={MySQL}; DATABASE=faqdb;UID=faq; PASSWORD=jakecat;"
Set RSBODY = Server.CreateObject("ADODB.Recordset")
SQLBODY = "SELECT * from Settings"
RSBODY.Open SQLBODY, Conn, 1, 3
If request("Action") = "Cat" Then
Set RSCat = Server.CreateObject("ADODB.Recordset")
SQLCat = "SELECT * from Categories WHERE ID=" & request("ID")
RSCat.Open SQLCat, Conn, 1, 3
CatName = RSCat("Category")
RSCat.close
Set RSCat = Nothing
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE Category=" & request("ID") & " AND
NOT Pending ORDER BY Question"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "Q" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Questions", Conn, 2, 2
RS.Find "ID=" & request("ID")
RS("Views") = RS("Views") + 1
RS.update
RS.close
Set RS = Nothing
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE ID=" & request("ID") & " AND NOT
Pending"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "Search" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE Question LIKE '%" &
request("Keyword") & "%' OR Answer LIKE '%" & request("Keyword") & "%' AND
NOT Pending"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "New" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE NOT Pending ORDER BY DateCreated
Desc"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "Ask2" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Questions", Conn, 2, 2
RS.addnew
RS("Question") = Request("Question")
RS("Category") = Request("Category")
RS("DateCreated") = Date
RS("Pending") = True
RS.update
End If
%>
Working script using access http://www.alfa-it.co.uk/faq/default.asp
(windows host)
Almost working script using mysql
http://www.automateyourgates.co.uk/faq/default.asp (apache host)
Any help much appreciated
Thanks
Chris.