数据库查询问题
<% name=Request.Form("student")
id=Request.Form("student")%>
<!-- #include file="include/conn.asp" -->
<% Set rs = server.CreateObject("ADODB.Recordset")
sql="select * from score where name='"&name&"'"
rs.Open sql,conn,1,1
Do While Not rs.eof
response.write (" <table> <tr> <td> 学号:"&rs("id")&" </td>")
response.write (" <td> 姓名:"&rs("name")&" </td>")
response.write (" <td> 语文:"&rs("yuwen")&" </td>")
response.write (" <td> 数学:"&rs("shuxue")&" </td>")
response.write (" <td> 英语:"&rs("yingyu")&" </td> </tr> </table>")
rs.movenext
Loop
rs.close
Set rs = Nothing
%>
为什么我这样查询会得不到结果呢。。。如在表单里输入“张三”提交后。。并没查到结果。。。虽然数据库的表里有“张三”
如果直接这样写。。可以显示结果的sql="select * from score where name='张三'"