请问HTML怎么循环输出数据?
<scripttype="text/javascript">functioninsert(){varuserid=getUserIdById(userid);varuse...
<script type="text/javascript">
function insert()
{
var userid = getUserIdById(userid);
var username = Request.Form("username");
var password = Request.Form("password");
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=db");
var sql = "insert into t1 (userid,username,password,) values("+userid+","+username+","+password+",getdate())";
rs.open(sql,conn);
rs.close();
conn.close();
rs=null;
conn=null;
}
function update()
{
var userid = getUserIdById(userid);
var username = Request.Form("username");
var password = Request.Form("password");
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=db");
var sql = "update t1 set username="username",password="password" where userid ="userid"";
rs.open(sql,conn);
rs.close();
conn.close();
rs=null;
conn=null;
}
</script>
</head>
<body>
<form method="post" name="form1">
<table width="200" border="1">
<tr>
<td>id</td>
<td>name</td>
<td>password</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
请问怎么让第二行的数据怎么从数据库读取循环输出?
JS输出也可以 展开
function insert()
{
var userid = getUserIdById(userid);
var username = Request.Form("username");
var password = Request.Form("password");
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=db");
var sql = "insert into t1 (userid,username,password,) values("+userid+","+username+","+password+",getdate())";
rs.open(sql,conn);
rs.close();
conn.close();
rs=null;
conn=null;
}
function update()
{
var userid = getUserIdById(userid);
var username = Request.Form("username");
var password = Request.Form("password");
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=db");
var sql = "update t1 set username="username",password="password" where userid ="userid"";
rs.open(sql,conn);
rs.close();
conn.close();
rs=null;
conn=null;
}
</script>
</head>
<body>
<form method="post" name="form1">
<table width="200" border="1">
<tr>
<td>id</td>
<td>name</td>
<td>password</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
请问怎么让第二行的数据怎么从数据库读取循环输出?
JS输出也可以 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询