一条sql??较基础

ICeeYeS 2003-09-28 07:26:28
password=replace(trim(Request("password")),"'","")

"select * from admin where password='"&password&"'

为什么sql中的password要这样写??要“”,和&&?
...全文
43 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
siriuscor 2003-09-28
  • 打赏
  • 举报
回复
"select * from admin where password='"&password&"'
这句有问题,应该是
"select * from admin where password='"&password&"'"
前面的select * from admin where password='是字符串,password是变量,后面的'是字符,所以中间用&&连接,
比如说password里的值是"faint",那么这句就成了
select * from admin where password='faint'
明白了不?
iamfred 2003-09-28
  • 打赏
  • 举报
回复
单独连接什么呢~~单独存在的啊~~跟谁连接呢
ICeeYeS 2003-09-28
  • 打赏
  • 举报
回复
&连接字符串我是知道的,可是在我上面的sql中,他连接什么呢?
fuzq 2003-09-28
  • 打赏
  • 举报
回复
这样说吧,,,
对于英文呢,,就不要加上' ' ,相对中文就得用' ',里面是变量名的值,数字也不用加''
&作为连接符,用于连接字符串?字符串,懂吧
ICeeYeS 2003-09-28
  • 打赏
  • 举报
回复
那&&连接什么呢?
没有也可以吧。?
cnpr 2003-09-28
  • 打赏
  • 举报
回复
http://www.eaoo.com/design/list.asp?classid=2&Nclassid=8
chinayang9 2003-09-28
  • 打赏
  • 举报
回复
&表示连接
“一定要有的,这样才是字符串

后布告sql语句时才可以使其运行。
avonqin 2003-09-28
  • 打赏
  • 举报
回复
sql中字符要放在""里,数字就不用了,&&之间是变量名

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧