using a form with a browse to file button i am able to successfully upload an image to a sql database using the following script, this updates a table called images:
i have another table called shape which i can insert another record using the following script:
what i’d like to be able to do combine the forms so i can have one form where i insert a record in both tables because an image is linked to the shape table on the field [imageid].
can anyone help me do this?
Ah dinnae ken...
Code:
<%
set upload = server.createobject("persits.upload")
upload.setmaxsize 100000, true
count = upload.save
set file = upload.files("logo")
if not file is nothing then
set rs = server.createobject("adodb.recordset")
rs.open "select * from [images] where [image]='" & hash & "'", conn, 2, 3
rs.addnew
rs("image") = file.binary
rs.update
response.write("successful")
else
response.write("fail")
end if
%>
i have another table called shape which i can insert another record using the following script:
Code:
<%
sql = "insert into shape ([shape index], [shape description], [imageid])"
sql = sql & " values "
sql = sql & "('" & request.form("shapeindex ") & "', '" & request.form("shapedescription") & "', '" & request.form("imageid") & "')"
%>
what i’d like to be able to do combine the forms so i can have one form where i insert a record in both tables because an image is linked to the shape table on the field [imageid].
can anyone help me do this?
Ah dinnae ken...