SQL.Add('select *from info where id='''+info_e1.text+'''') 其中的引号怎么解释啊

来源:百度知道 编辑:UC知道 时间:2024/06/14 16:09:03
如果student_id是字符型的话 querystu.SQL.Add('select student_id from basic_info where student_id='''+info_e1.text+''''); 其中的引号怎么解释啊呀 其中的引号怎么回事啊,最后为什么是四个引号啊

info_e1.text 是字符串类型,所以要用''引起来,建议你最好不要这么写,很容易被sql注入攻击

info_e1.text 是字符串类型,所以要用''引起来,
但是 sql.add()括号里有单引号了,为了不引起混乱,所以里面用了双引号。
建议你最好不要这么写,很容易被sql注入攻击