作者:手机用户2602934117 | 来源:互联网 | 2023-05-18 05:16
stripslashes()?Thatslameandso4.0.Whatsthe5.0counterpartofmysqli::real_escape_stringth
stripslashes() ? That's lame and so 4.0. What's the 5.0 counterpart of mysqli::real_escape_string that strips all slashes added for SQL queries?
stripslashes()?那是蹩脚的,所以4.0。什么是mysqli :: real_escape_string的5.0版本,它删除了为SQL查询添加的所有斜杠?
Got some other questions:
还有其他一些问题:
Tried to update a record and added a single quote in a text field, turns out phpMyAdmin escapes the string with single quotes instead of slashes - e.g. a single quote is escaped as '' (2 single quotes) instead of \' - what function is phpMyAdmin using or is it its own? So, mysql supports 2 approaches for escaping strings, namely slash and single quote?
试图更新记录并在文本字段中添加单引号,结果phpMyAdmin用单引号而不是斜线转义字符串 - 例如单引号转义为''(2个单引号)而不是\' - phpMyAdmin使用的功能是什么,或者它是自己的?那么,mysql支持两种转义字符串的方法,即斜杠和单引号?
Do I always have to unslash the string selected from mysql? Cause' you know it's slashed at insertion. But I thought I don't have to.
我是否总是要取消从mysql中选择的字符串?因为'你知道它在插入时被削减了。但我以为我不必。
Any ideas, thanks!
任何想法,谢谢!
3 个解决方案