Who will give the mysql escape function to the younger brother?-php Tutorial

Source: Internet
Author: User
Tags php mysql
Who gave the mysql escape function to the younger brother?

Who will give the PHP mysql escape function to the younger brother? it seems that the function has to be reversed during the query!

<> It should be possible to convert a symbol like this.


Reply to discussion (solution)

If the escape character string is good, do you want to escape the entire statement?

I don't know. it's just a form submission. if you enter MYSQL, it will be converted.

Abc

Isn't that miserable?

I don't know. it's just a form submission. if you enter MYSQL, it will be converted.

Abc

Isn't that miserable?
This is to be switched. Otherwise, an error will occur.
The warehouse receiving function can be transferred. the warehouse receiving function is not required.
Examples
Example 1. mysql_escape_string () example

$ Item = "Zak's Laptop ";
$ Escaped_item = mysql_escape_string ($ item );
Printf ("Escaped string: % s \ n", $ escaped_item );
?>

The above example will output:

Escaped string: Zak \'s Laptop



Notes
Note: mysql_escape_string () does not escape % and _.

See Also


Mysql_real_escape_string ()
Addslashes ()
The magic_quotes_gpc directive.

Why?

44 is new. why is it empty?

44 is new. why is it empty?
You can see that the mysql_escape_string function is followed by a string, but you can give it an array .. The form you received is converted one by one before receiving the database!

Thank you! I just don't know why I sent some extra code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.