Lernaian
04-13-2004, 04:47 AM
I'm going freefall here and completely write what I think might be true of how this is done. I'm trying to update my table of members. In the SQL database there are these sections:
"member.number,
firstname,
lastname,
telephone,
pers.id,
fee,
password."
Only firstname, lastname, telephone, pers.id, password shall be inserted into the members table. here is my code:
----------------------------------------------------------------------------
<html>
<head>
<title>Create user</title>
</head>
<body>
<center><H1>fill in here</H1>
<FORM METHOD=POST ACTION="update.code.asp">
Firstname: <INPUT TYPE="text" NAME="firstname" size="20"><BR>
Lastname: <INPUT TYPE="text" NAME="lastname" size="20"><BR>
Telephone: <INPUT TYPE="text" NAME="telephone" size="20"><BR>
Personal ID: <INPUT TYPE="text" NAME="persid" size="20"><BR>
Password: <INPUT TYPE="password" NAME="password" size="20"><BR>
<INPUT TYPE="submit" VALUE="add">
<INPUT TYPE="reset" VALUE="erase">
</FORM>
</center>
</body>
</html>
----------------------------------------------------------------------------
<HTML>
<HEAD>
<TITLE> update</TITLE>
</HEAD>
<BODY>
<%
session("firstname")=firstname
session("lastname")=lastname
session("telephone")=telephone
session("persid")=persid
session("password")=password
set dbconn=Server.CreateObject("ADODB.Connection")
dhdb ="Driver={SQL Server};Server=127.0.0.1;DATABASE=****;UID=****;PWD=****;"
dbconn.Open(dhdb)
Set rs = Server.CreateObject("ADODB.Recordset")
sqlQuery="INSERT INTO members(firstname,lastname,telephone,pers.id,password)
VALUES("firstname","lastname","telephone","persid","password")"
set rs=dbconn.Execute(sqlQuery)
response.redirect("login.asp")
rs.Close
dbconn.Close
%>
</BODY>
</HTML>
------------------------------------------------------------------------------------
Thanks in advance. I don't have the opporturnety to try this myself untill late tomorrow so I would really appriciate some feedback from you guys :) you rock!
"member.number,
firstname,
lastname,
telephone,
pers.id,
fee,
password."
Only firstname, lastname, telephone, pers.id, password shall be inserted into the members table. here is my code:
----------------------------------------------------------------------------
<html>
<head>
<title>Create user</title>
</head>
<body>
<center><H1>fill in here</H1>
<FORM METHOD=POST ACTION="update.code.asp">
Firstname: <INPUT TYPE="text" NAME="firstname" size="20"><BR>
Lastname: <INPUT TYPE="text" NAME="lastname" size="20"><BR>
Telephone: <INPUT TYPE="text" NAME="telephone" size="20"><BR>
Personal ID: <INPUT TYPE="text" NAME="persid" size="20"><BR>
Password: <INPUT TYPE="password" NAME="password" size="20"><BR>
<INPUT TYPE="submit" VALUE="add">
<INPUT TYPE="reset" VALUE="erase">
</FORM>
</center>
</body>
</html>
----------------------------------------------------------------------------
<HTML>
<HEAD>
<TITLE> update</TITLE>
</HEAD>
<BODY>
<%
session("firstname")=firstname
session("lastname")=lastname
session("telephone")=telephone
session("persid")=persid
session("password")=password
set dbconn=Server.CreateObject("ADODB.Connection")
dhdb ="Driver={SQL Server};Server=127.0.0.1;DATABASE=****;UID=****;PWD=****;"
dbconn.Open(dhdb)
Set rs = Server.CreateObject("ADODB.Recordset")
sqlQuery="INSERT INTO members(firstname,lastname,telephone,pers.id,password)
VALUES("firstname","lastname","telephone","persid","password")"
set rs=dbconn.Execute(sqlQuery)
response.redirect("login.asp")
rs.Close
dbconn.Close
%>
</BODY>
</HTML>
------------------------------------------------------------------------------------
Thanks in advance. I don't have the opporturnety to try this myself untill late tomorrow so I would really appriciate some feedback from you guys :) you rock!