PDO anti-injection a question, after all, to quote or do not quote the good

Source: Internet
Author: User
PDO anti-injection a question, in the end to the quotation marks or do not quote good?
This post was last edited by sky94132003 on 2014-08-27 06:07:37

PDO anti-injection
PHP version is 5.4.28
It's with MySQL.

All SQL statements have been preprocessed

Is it enough to be safe?

Heard that some people save is like to use the Pdo::quote field all add single quotation marks

Is it necessary to have some older PHP versions?

Is it necessary to do this without pre-processing?

Here are some of the common code patterns

Is it enough on the anti-SQL note?

Ask if there is any need to improve the place?


$add _title= "INSERT into ' topic_title ' (' id ', ' title_name ', ' typeid ') VALUES (Null,:title_name,:typeid)";
$stmt = $pdo->prepare ($add _title);
$stmt->bindparam (': Title_name ', $title _name);
$stmt->bindparam (': typeid ', $typeid);
$stmt->execute ();

------Solution--------------------
Yes, as far as the current scope of knowledge is concerned: enough
------Solution--------------------
Enough, prepare has been put into the treatment of injection.
------Solution--------------------
Safety has been enough.
  • 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.