DeveloperSide.NET Forums

DeveloperSide.NET => Building a Web Server, for Linux => Topic started by: randy orr on July 12, 2004, 02:52:58 PM



Title: MYSQL HEADACHES
Post by: randy orr on July 12, 2004, 02:52:58 PM
Can someone please help m?! I am about to delete this thing and walk away!! I have almost all of the coding written and working on my pages to communticate with my database. One last query is keeping it from being finished... can someone take a look at this and tell me why I am getting a syntax error?

<% Response.Buffer = True %>
<!-- #include virtual="/common/adovbs.inc" --> <%
Dim Connect, Record, Query, ISOK
Set connect = server.createobject("adodb.connection")
Set Record = server.createobject("adodb.recordset")

ISOK = "YES"
if Request("Action") = "DELETE THIS RECORD!" then
connect.open "DATABASE"
query = "DELETE FROM 'TABLE' WHERE (ID=" & Request("EDIT") & ")"
Record.open query, connect, adOpenStatic, adLockOptimistic
Response.Write "Deleted record :" & request("Edit") & "<br>"
else
if request("Jobtitle") = "" then
Response.Write "<b>Job Title Name</b> Missing! Cannot Add Record!<br>"
ISOK = "NO"
end if
if ISOK <> "NO" then

if Request("EDIT") <> "" then
connect.open "DATABASE"
query = "SELECT FROM WHERE (ID=" & Request("EDIT") & ") limit 1"
Record.open query, connect, adOpenStatic, adLockOptimistic
Response.Write "Editing record :" & request("Edit") & "<br>"
else
connect.open "DATABASE"
query = "SELECT * FROM
"
Record.open query, connect, adOpenStatic, adLockOptimistic
Record.AddNew
Response.write "Adding Record<br>"
end if

Record("JobTitle") = Request("JobTitle")
Record("JobDesc") = Request("JobDesc")
Record("Jobloc") = Request("Jobloc")
Record("salary") = Request("salary")

record.update
if Request("EDIT") = "" then
Response.Write "Record Added Successfully<br>"
else
Response.Write "Record Edited Successfully<br>"
end if

end if 'if Request("Action") = "DELETE THIS RECORD!" then
end if 'if ISOK <> "NO" then
%>


It says that my error is "NEAR" the "DELETE FROM TABLE" query


Title: MYSQL HEADACHES
Post by: admin on July 12, 2004, 10:07:07 PM
The only thing I can offer is a link to the "delete" syntax...

http://dev.mysql.com/doc/mysql/en/DELETE.html