PHP中addslashes与mysql_escape_string的区别分析,mysqlescapestring
PHP中addslashes与mysql_escape_string的区别分析,mysqlescapestring
本文实例分析了PHP中addslashes与mysql_escape_string的区别。分享给大家供大家参考,具体如下:
1.在插入数据时两者的意义基本一样.区别只在于addslashes
在magic_quotes_sybase=on时将“ '”转换成“ ' '”
在magic_quotes_sybase=off时将“ '”转换成“\ '”
而mysql_escape_string总是将“ '”转换成“\ '”
2.mysql_escape_string在php6中将被抛弃,所以最好避免用它.
而且最好用面向对象的mysqli::real_escape_string,
如果非要用面向过程的话可以用mysql_real_escape_string
更多关于PHP相关内容感兴趣的读者可查看本站专题:《PHP数据结构与算法教程》、《PHP运算与运算符用法总结》、《PHP网络编程技巧总结》、《PHP基本语法入门教程》、《php操作office文档技巧总结(包括word,excel,access,ppt)》、《php日期与时间用法总结》、《php面向对象程序设计入门教程》、《php字符串(string)用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》
希望本文所述对大家PHP程序设计有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.