where's your execute line?
oconn.execute (sqltext)
all you're doing is putting the sql statement into a variable and nothing
else.
----- Original Message -----
From: "Defryn, Guy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 03, 2002 12:41 PM
Subject: Insert with ASP into mysql
Hi there,
I want to insert data in a mysql database. When I submit
I don't get any errors. It takes me to the page that processes everything
However, when I check the database the records are not there.
Selecting data from the website works fine. My code is below
but I don't think anything is wrong because I don't get any errors.
Any ideas?
<%
dim
product,amount,cluster,user,orderdate,entered,comment,oconn,sqltext,arrdate
function newstr(str)
newstr=replace(replace(str,"'","''"),chr(34),""")
End function
product=request.form("product")
amount=request.form("amount")
cluster=request.form("cluster")
user=newstr(request.form("user"))
orderdate=request.form("orderdate")
comment=newstr(request.form("comment"))
entered=request.form("entered")
set oconn = server.createobject("Adodb.connection")
oconn.connectionstring =
"server=130.123.80.73;driver=MySQL;db=supplies;uid=itsupport;pwd=itsupport"
oconn.open
sqltext = "Insert into
orders(orderid,product,amount,cluster,user,orderdate,comment,entered)"
sqltext = sqltext & " values(NULL," & product & "," & amount & ",'" &
cluster & "','" & user & "',#" & orderdate & "#,'" & comment & "','" &
entered & "')"
oconn.close
set oconn = nothing
%>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php