I have an asp website, and i was using an MS Acess database, and i had to move to MySQL. I'm using a database converter, and some of the data shows, and other pulls up errors which im trying to resolve.
At the bottom is the full code of this page, but here is the part that seems to be causing the problem.
When i ran the above code in the MySQL query analayser this is the result:
So does anyone know what i need to do? how can i solve this problem? I'm prepared to change the method of importing data, but don't know how to do it. I used a database converter, as i thought it would be easy, but even the database converter cant convert some of code it seems
I am including all the relevant code in this page below, as it may be clearer to anyone who understands , what the problem may be.
any help appreciated, thanks in advance
At the bottom is the full code of this page, but here is the part that seems to be causing the problem.
Code:
SELECT TOP 1 ID FROM nm_tbl_comment WHERE fldNEWS_ID = 3324 AND ID > 585 ORDER BY ID ASC
error 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 ID, `ID` FROM nm_tbl_comment WHERE fldNEWS_ID = 3324 AND ID > 585 ORDER BY ID' at line 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 ID, `ID` FROM nm_tbl_comment WHERE fldNEWS_ID = 3324 AND ID > 585 ORDER BY ID' at line 1
So does anyone know what i need to do? how can i solve this problem? I'm prepared to change the method of importing data, but don't know how to do it. I used a database converter, as i thought it would be easy, but even the database converter cant convert some of code it seems
I am including all the relevant code in this page below, as it may be clearer to anyone who understands , what the problem may be.
Code:
<!--#include file="../config.asp"-->
<% Dim ID, RS, SQL, NAME, EMAIL, COMMENT, sDATE, IO, M_ID, SUBJECT, CITY, COUNTRY, ALLOW_E, AID, NEXT_ID, BACK_ID
ID = Trim(Request.QueryString("ID"))
AID = Trim(Request.QueryString("AID"))
IF IS_VALID_ID(ID) = False OR IS_VALID_ID(AID) = False THEN Response.END
IF Trim(Session("PMMS_IN")) = "True" THEN blLOGGED_IN = True
SQL = "SELECT fldNAME, fldEMAIL, fldCOMMENT, fldDATE, fldIP, fldM_ID, fldSUBJECT, fldCITY, fldCOUNTRY, fldALLOW FROM nm_tbl_comment WHERE ID = " & ID
Call OPEN_DB()
' Comment details
Set RS = Server.CreateObject("ADODB.Recordset")
RS.LockType = 1
RS.CursorType = 0
RS.Open SQL, MyConn
IF NOT RS.EOF THEN
NAME = trim(RS("fldNAME"))
EMAIL = trim(RS("fldEMAIL"))
COMMENT = trim(RS("fldCOMMENT")) & ""
sDATE = trim(RS("fldDATE"))
IP = trim(RS("fldIP"))
M_ID = trim(RS("fldM_ID"))
SUBJECT = trim(RS("fldSUBJECT"))
CITY = trim(RS("fldCITY"))
COUNTRY = trim(RS("fldCOUNTRY"))
ALLOW_E = trim(RS("fldALLOW"))
END IF
RS.Close
Set RS = Nothing
' Next Link
SQL = "SELECT TOP 1 ID FROM nm_tbl_comment WHERE fldNEWS_ID = " & AID & " AND ID > " & ID & " ORDER BY ID ASC"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL, MyConn
IF NOT RS.EOF THEN
NEXT_ID = trim(RS("ID"))
END IF
RS.Close
Set RS = Nothing
' Back Link
SQL = "SELECT TOP 1 ID FROM nm_tbl_comment WHERE fldNEWS_ID = " & AID & " AND ID < " & ID & " ORDER BY ID DESC"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL, MyConn
IF NOT RS.EOF THEN
BACK_ID = trim(RS("ID"))
END IF
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
%>
Comment