I have the following code
and I keep getting the error
but I can't see the problem
Code:
thenum = 0
rsSQL="SELECT userreviews.RestuarantId, dataqfol.Company, dataqfol.Address1, dataqfol.Address2, dataqfol.Address3, dataqfol.City, dataqfol.County, dataqfol.Postcode, dataqfol.ID, dataqfol.Phone, dataqfol.Fax, dataqfol.Cuisine, dataqfol.URL, dataqfol.email, dataqfol.Description, dataqfol.IsClient, dataqfol.details, dataqfol.datamenu FROM dataqfol"
if TheRName <> "" then
rsSQL = rsSQL & " WHERE Company LIKE '%" & TheRName & "%'"
thenum = 1
end if
if TheTown <> "" and thenum = 0 then
rsSQL = rsSQL & " WHERE City LIKE '%" & TheTown & "%'"
thenum = 1
else if TheTown <> "" and thenum = 1 then
rsSQL = rsSQL & " AND City LIKE '%" & TheTown & "%'"
end if
end if
if TheCounty <> "" and thenum = 0 then
rsSQL = rsSQL & " WHERE County LIKE '%" & TheCounty & "%'"
thenum = 1
else if TheCounty <> "" and thenum = 1 then
rsSQL = rsSQL & " AND County LIKE '%" & TheCounty & "%'"
end if
end if
if ThePostcode <> "" and thenum = 0 then
rsSQL = rsSQL & " WHERE Postcode LIKE '" & ThePostcode & "%'"
thenum = 1
else if ThePostcode <> "" and thenum = 1 then
rsSQL = rsSQL & " AND Poscode LIKE '" & ThePostcode & "%'"
end if
end if
rsSQL = rsSQL & " INNER JOIN userreviews ON (dataqfol.web_ID = userreviews.RestuarantId) ORDER BY IsClient ASC, Company ASC LIMIT " & limitvalue & ", " & numresults & ""
set rs = server.CreateObject("ADODB.recordset")
rs.open rsSQL, objConn
and I keep getting the error
Code:
[MySQL][ODBC 3.51 Driver][mysqld-4.0.20a-nt]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 'INNER JOIN userreviews ON (dataqfol.web_ID = userreviews.Restua
but I can't see the problem