Ive just started learning ASP and i am using MySQL databases. So far ive managed to make a newsposting thing that allows me to insert news and read them. Now i want to have the option of deleting data from the database directly from the site, but whatever i try to write in the sql command it doesn't want to work. I don't know where i should ask this question but ill start here =)
ive read several guides but some of them are PHP guides or ASP but msaccess databases.
this is how my stuff looks at the moment:
(page name: newsremove.asp)
Code:
<%
if request("delid") <> "" then
delid=request("delid")
sql="DELETE * FROM news WHERE ID=" & delid
conn.execute(sql)
end if
%>
<form action="newsremove.asp" method="post">
Type in the ID of the post you wish to remove: <input type="text" name="delid" size=20><br>
<input type="submit" value="remove this post!">
</form>
I also have this little part where i show all the news but i don't think it has anything to do with the errors i get.
Code:
do until rs.eof
response.write "<hr align=left width=300 size=2 color=black noshading>"
response.write rs("time") & " by " & rs("poster") & ". ID: " & rs("id")
rs.moveNext
loop
The errors i get when i try to remove a entry is
"ADODB.Connection.1 (0x80004005)
SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]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 '* FROM news WHERE ID=9' at line 1
/newsremove.asp, line 25"
ANY HELP AT ALL IS VERY THX!