{"id":1272,"date":"2026-01-06T17:31:58","date_gmt":"2026-01-06T09:31:58","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=1272"},"modified":"2026-01-06T17:31:58","modified_gmt":"2026-01-06T09:31:58","slug":"php%e4%b8%ad%e9%98%b2sql%e6%b3%a8%e5%85%a5%e7%9a%84%e4%b8%bb%e8%a6%81%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2026\/01\/06\/php%e4%b8%ad%e9%98%b2sql%e6%b3%a8%e5%85%a5%e7%9a%84%e4%b8%bb%e8%a6%81%e6%96%b9%e6%b3%95\/","title":{"rendered":"PHP\u4e2d\u9632SQL\u6ce8\u5165\u7684\u4e3b\u8981\u65b9\u6cd5"},"content":{"rendered":"\n<p><strong>SQL \u6ce8\u5165<\/strong>\uff08SQL Injection\uff09\u662f\u4e00\u79cd\u5e38\u89c1\u7684 Web \u5b89\u9669\u6f0f\u6d1e\uff0c\u653b\u51fb\u8005\u901a\u8fc7\u6076\u610f\u6784\u9020 SQL \u67e5\u8be2\u8bed\u53e5\uff0c\u4ece\u800c\u7ed5\u8fc7\u8eab\u4efd\u9a8c\u8bc1\u3001\u8bfb\u53d6\u3001\u4fee\u6539\u6216\u5220\u9664\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\uff0c\u751a\u81f3\u53ef\u4ee5\u6267\u884c\u7cfb\u7edf\u547d\u4ee4\u3002<\/p>\n\n\n\n<p>\u5728 PHP \u4e2d\u9632\u6b62 SQL \u6ce8\u5165\u6709\u5f88\u591a\u6709\u6548\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f <strong>\u4e3b\u8981\u7684\u9632\u6b62 SQL \u6ce8\u5165\u7684\u6280\u672f\u4e0e\u7b56\u7565<\/strong>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u4f7f\u7528 <strong>\u9884\u5904\u7406\u8bed\u53e5<\/strong>\uff08Prepared Statements\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u63a8\u8350\u65b9\u6cd5\uff1a<\/strong><\/h3>\n\n\n\n<p>\u4f7f\u7528 <strong>PDO<\/strong> \u6216 <strong>MySQLi<\/strong> \u63d0\u4f9b\u7684 <strong>\u9884\u5904\u7406\u8bed\u53e5<\/strong>\uff0c\u5b83\u53ef\u4ee5\u786e\u4fdd SQL \u67e5\u8be2\u548c\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u662f\u5206\u79bb\u7684\uff0c\u6781\u5927\u5730\u51cf\u5c11\u4e86 SQL \u6ce8\u5165\u7684\u98ce\u9669\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 <strong>PDO \u793a\u4f8b<\/strong>\uff08\u63a8\u8350\uff09<\/h3>\n\n\n\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 <code>prepare()<\/code> \u65b9\u6cd5\u51c6\u5907 SQL \u8bed\u53e5\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528 <code>bindParam()<\/code> \u6216 <code>bindValue()<\/code> \u65b9\u6cd5\u7ed1\u5b9a\u53c2\u6570\uff0c\u907f\u514d\u7528\u6237\u8f93\u5165\u76f4\u63a5\u8fdb\u5165 SQL \u67e5\u8be2\u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\ntry {\n    \/\/ \u521b\u5efa PDO \u5b9e\u4f8b\uff0c\u8fde\u63a5\u5230 MySQL \u6570\u636e\u5e93\n    $pdo = new PDO(&#039;mysql:host=localhost;dbname=test&#039;, &#039;root&#039;, &#039;&#039;);\n    $pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n    \n    \/\/ \u4f7f\u7528\u9884\u5904\u7406\u8bed\u53e5\n    $stmt = $pdo-&gt;prepare(&quot;SELECT * FROM users WHERE username = :username AND password = :password&quot;);\n    \n    \/\/ \u7ed1\u5b9a\u7528\u6237\u8f93\u5165\u7684\u53c2\u6570\n    $stmt-&gt;bindParam(&#039;:username&#039;, $username, PDO::PARAM_STR);\n    $stmt-&gt;bindParam(&#039;:password&#039;, $password, PDO::PARAM_STR);\n    \n    \/\/ \u8bbe\u7f6e\u5b9e\u9645\u7684\u8f93\u5165\u503c\n    $username = $_POST&#x5B;&#039;username&#039;];\n    $password = $_POST&#x5B;&#039;password&#039;];\n    \n    \/\/ \u6267\u884c SQL \u67e5\u8be2\n    $stmt-&gt;execute();\n    \n    \/\/ \u83b7\u53d6\u67e5\u8be2\u7ed3\u679c\n    $result = $stmt-&gt;fetch(PDO::FETCH_ASSOC);\n    \n    if ($result) {\n        echo &quot;Login successful!&quot;;\n    } else {\n        echo &quot;Invalid username or password!&quot;;\n    }\n} catch (PDOException $e) {\n    echo &quot;Error: &quot; . $e-&gt;getMessage();\n}\n?&gt;\n\n<\/pre><\/div>\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>prepare()<\/code> \u65b9\u6cd5\u5c06 SQL \u67e5\u8be2\u8bed\u53e5\u548c\u7528\u6237\u8f93\u5165\u5206\u5f00\uff0c\u907f\u514d SQL \u6ce8\u5165\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528 <code>bindParam()<\/code> \u6216 <code>bindValue()<\/code> \u5c06\u53c2\u6570\u7ed1\u5b9a\u5230\u67e5\u8be2\u4e2d\uff0cPDO \u4f1a\u81ea\u52a8\u5904\u7406\u8f6c\u4e49\u548c\u7c7b\u578b\u5b89\u5168\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 <strong>MySQLi \u793a\u4f8b<\/strong>\uff08\u652f\u6301\u9762\u5411\u5bf9\u8c61\u548c\u8fc7\u7a0b\u5316\u98ce\u683c\uff09<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n\/\/ \u4f7f\u7528 MySQLi \u8fde\u63a5\u6570\u636e\u5e93\n$mysqli = new mysqli(&quot;localhost&quot;, &quot;root&quot;, &quot;&quot;, &quot;test&quot;);\n\n\/\/ \u68c0\u67e5\u8fde\u63a5\u662f\u5426\u6210\u529f\nif ($mysqli-&gt;connect_error) {\n    die(&quot;Connection failed: &quot; . $mysqli-&gt;connect_error);\n}\n\n\/\/ \u4f7f\u7528\u9884\u5904\u7406\u8bed\u53e5\n$stmt = $mysqli-&gt;prepare(&quot;SELECT * FROM users WHERE username = ? AND password = ?&quot;);\n$stmt-&gt;bind_param(&quot;ss&quot;, $username, $password);\n\n\/\/ \u83b7\u53d6\u7528\u6237\u8f93\u5165\u7684\u53c2\u6570\n$username = $_POST&#x5B;&#039;username&#039;];\n$password = $_POST&#x5B;&#039;password&#039;];\n\n\/\/ \u6267\u884c\u67e5\u8be2\n$stmt-&gt;execute();\n\n\/\/ \u83b7\u53d6\u7ed3\u679c\n$result = $stmt-&gt;get_result();\n\nif ($result-&gt;num_rows &gt; 0) {\n    echo &quot;Login successful!&quot;;\n} else {\n    echo &quot;Invalid username or password!&quot;;\n}\n\n\/\/ \u5173\u95ed\u8fde\u63a5\n$stmt-&gt;close();\n$mysqli-&gt;close();\n?&gt;\n\n<\/pre><\/div>\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u901a\u8fc7 <code>prepare()<\/code> \u548c <code>bind_param()<\/code>\uff0cMySQLi \u4e5f\u786e\u4fdd\u7528\u6237\u8f93\u5165\u4e0e SQL \u8bed\u53e5\u5206\u79bb\uff0c\u9632\u6b62\u4e86 SQL \u6ce8\u5165\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u4f7f\u7528 <strong>\u53c2\u6570\u5316\u67e5\u8be2<\/strong>\uff08Parameterized Queries\uff09<\/h2>\n\n\n\n<p>\u901a\u8fc7\u5c06\u7528\u6237\u8f93\u5165\u4f5c\u4e3a\u53c2\u6570\u800c\u4e0d\u662f\u76f4\u63a5\u62fc\u63a5\u5728 SQL \u8bed\u53e5\u4e2d\uff0c\u53ef\u4ee5\u907f\u514d SQL \u6ce8\u5165\u653b\u51fb\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u793a\u4f8b\uff1a<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n\/\/ \u4f7f\u7528 MySQLi \u6267\u884c\u53c2\u6570\u5316\u67e5\u8be2\n$query = &quot;SELECT * FROM users WHERE username = :username AND password = :password&quot;;\n$stmt = $db-&gt;prepare($query);\n\n$stmt-&gt;bindParam(&#039;:username&#039;, $_POST&#x5B;&#039;username&#039;]);\n$stmt-&gt;bindParam(&#039;:password&#039;, $_POST&#x5B;&#039;password&#039;]);\n\n$stmt-&gt;execute();\n?&gt;\n\n<\/pre><\/div>\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>:username<\/code> \u548c <code>:password<\/code> \u662f\u5360\u4f4d\u7b26\uff0c\u7528\u6237\u8f93\u5165\u5c06\u901a\u8fc7 <code>bindParam()<\/code> \u65b9\u6cd5\u5b89\u5168\u7ed1\u5b9a\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u907f\u514d\u76f4\u63a5\u62fc\u63a5 SQL \u8bed\u53e5<\/h2>\n\n\n\n<p>\u5728\u6ca1\u6709\u9884\u5904\u7406\u8bed\u53e5\u7684\u60c5\u51b5\u4e0b\uff0c\u907f\u514d\u76f4\u63a5\u62fc\u63a5\u7528\u6237\u8f93\u5165\u5230 SQL \u8bed\u53e5\u4e2d\u3002\u76f4\u63a5\u62fc\u63a5\u53ef\u80fd\u4f1a\u5bfc\u81f4 SQL \u6ce8\u5165\u6f0f\u6d1e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u9519\u8bef\u7684\u793a\u4f8b\uff1a<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n$username = $_POST&#x5B;&#039;username&#039;];\n$password = $_POST&#x5B;&#039;password&#039;];\n\n$query = &quot;SELECT * FROM users WHERE username = &#039;$username&#039; AND password = &#039;$password&#039;&quot;;\n$result = mysqli_query($db, $query);\n?&gt;\n\n<\/pre><\/div>\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u76f4\u63a5\u5c06 <code>$username<\/code> \u548c <code>$password<\/code> \u62fc\u63a5\u5230 SQL \u8bed\u53e5\u4e2d\uff0c\u653b\u51fb\u8005\u53ef\u4ee5\u901a\u8fc7\u7279\u6b8a\u5b57\u7b26\uff08\u4f8b\u5982 <code>'<\/code>\uff09\u4fee\u6539\u67e5\u8be2\u8bed\u53e5\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u5b89\u5168\u7684\u505a\u6cd5\uff1a<\/strong><\/h3>\n\n\n\n<p>\u4f7f\u7528 <code>prepare()<\/code>\u3001<code>bindParam()<\/code> \u6216 <code>bindValue()<\/code> \u6765\u907f\u514d\u62fc\u63a5\u7528\u6237\u8f93\u5165\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u4f7f\u7528 <strong>\u6570\u636e\u5e93\u6743\u9650\u6700\u5c0f\u5316<\/strong><\/h2>\n\n\n\n<p>\u5728 PHP \u4e0e\u6570\u636e\u5e93\u4ea4\u4e92\u65f6\uff0c\u786e\u4fdd\u4f7f\u7528\u7684\u6570\u636e\u5e93\u8d26\u6237 <strong>\u6743\u9650\u6700\u5c0f\u5316<\/strong>\u3002\u5373\u6570\u636e\u5e93\u7528\u6237\u53ea\u5e94\u8be5\u6709\u6267\u884c\u67e5\u8be2\u7684\u5fc5\u8981\u6743\u9650\uff0c\u907f\u514d\u6388\u4e88\u5220\u9664\u3001\u66f4\u65b0\u7b49\u9ad8\u98ce\u9669\u6743\u9650\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u6b65\u9aa4\uff1a<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u8981\u4f7f\u7528 <code>root<\/code> \u7528\u6237\u8fdb\u884c Web \u5e94\u7528\u8bbf\u95ee\u3002<\/li>\n\n\n\n<li>\u521b\u5efa\u4e13\u95e8\u7684\u6570\u636e\u5e93\u7528\u6237\uff0c\u9650\u5236\u5176\u4ec5\u80fd\u8bfb\u53d6\u6570\u636e\uff0c\u6267\u884c\u67e5\u8be2\u7b49\u64cd\u4f5c\u3002<\/li>\n\n\n\n<li>\u5b9a\u671f\u68c0\u67e5\u5e76\u66f4\u65b0\u6570\u636e\u5e93\u7528\u6237\u7684\u6743\u9650\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u907f\u514d\u4f7f\u7528 <strong>\u5371\u9669\u7684 SQL \u51fd\u6570<\/strong><\/h2>\n\n\n\n<p>\u67d0\u4e9b SQL \u51fd\u6570\u53ef\u80fd\u4f1a\u5e26\u6765\u5b89\u5168\u98ce\u9669\uff0c\u907f\u514d\u5728\u7528\u6237\u8f93\u5165\u7684\u5730\u65b9\u4f7f\u7528\u5b83\u4eec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>mysql_query()<\/code><\/strong> \u548c <strong><code>mysql_*<\/code><\/strong> \u7cfb\u5217\u51fd\u6570\uff08\u5df2\u5e9f\u5f03\uff09<\/li>\n\n\n\n<li><strong><code>eval()<\/code><\/strong>\uff08\u4e0d\u8981\u52a8\u6001\u6267\u884c SQL \u8bed\u53e5\uff09<\/li>\n<\/ul>\n\n\n\n<p>\u901a\u8fc7 <strong>PDO<\/strong> \u6216 <strong>MySQLi<\/strong> \u7b49\u73b0\u4ee3\u6570\u636e\u5e93\u5e93\uff0c\u907f\u514d\u4f7f\u7528\u8fd9\u4e9b\u4e0d\u5b89\u5168\u7684\u51fd\u6570\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u6570\u636e\u9a8c\u8bc1\u4e0e\u8fc7\u6ee4<\/h2>\n\n\n\n<p>\u9664\u4e86 SQL \u6ce8\u5165\uff0c\u8fd8\u8981\u5bf9\u7528\u6237\u8f93\u5165\u8fdb\u884c\u5176\u4ed6\u5f62\u5f0f\u7684\u9a8c\u8bc1\u548c\u8fc7\u6ee4\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. \u9a8c\u8bc1\u8f93\u5165\u683c\u5f0f<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\nif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n    echo &quot;Invalid email format!&quot;;\n}\n?&gt;\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>2. \u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f<\/strong><\/h3>\n\n\n\n<p>\u4f8b\u5982\uff0c\u9650\u5236\u7528\u6237\u540d\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u548c\u6570\u5b57\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\nif (!preg_match(&quot;\/^&#x5B;a-zA-Z0-9]*$\/&quot;, $username)) {\n    echo &quot;Invalid username!&quot;;\n}\n?&gt;\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u5b9a\u671f\u66f4\u65b0\u6570\u636e\u5e93\u548c\u5e94\u7528\u7a0b\u5e8f<\/h2>\n\n\n\n<p>\u5b9a\u671f\u66f4\u65b0 PHP \u548c\u6570\u636e\u5e93\u9a71\u52a8\uff0c\u4ee5\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6ca1\u6709\u5df2\u77e5\u7684\u6f0f\u6d1e\u3002\u4fdd\u6301\u7cfb\u7edf\u66f4\u65b0\uff0c\u4ee5\u9632\u6b62\u653b\u51fb\u8005\u5229\u7528\u5df2\u77e5\u7684 SQL \u6ce8\u5165\u6f0f\u6d1e\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u603b\u7ed3<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9632\u8303\u65b9\u6cd5<\/th><th>\u63cf\u8ff0<\/th><\/tr><\/thead><tbody><tr><td><strong>\u9884\u5904\u7406\u8bed\u53e5<\/strong><\/td><td>\u4f7f\u7528 PDO \u6216 MySQLi \u7684\u9884\u5904\u7406\u8bed\u53e5\uff0c\u907f\u514d SQL \u62fc\u63a5\u3002<\/td><\/tr><tr><td><strong>\u53c2\u6570\u5316\u67e5\u8be2<\/strong><\/td><td>\u4f7f\u7528\u5360\u4f4d\u7b26\u548c\u7ed1\u5b9a\u53c2\u6570\u7684\u65b9\u6cd5\uff0c\u786e\u4fdd\u8f93\u5165\u5b89\u5168\u3002<\/td><\/tr><tr><td><strong>\u907f\u514d\u62fc\u63a5 SQL<\/strong><\/td><td>\u6c38\u8fdc\u4e0d\u8981\u76f4\u63a5\u62fc\u63a5\u7528\u6237\u8f93\u5165\u5230 SQL \u8bed\u53e5\u4e2d\u3002<\/td><\/tr><tr><td><strong>\u6700\u5c0f\u6743\u9650\u539f\u5219<\/strong><\/td><td>\u9650\u5236\u6570\u636e\u5e93\u7528\u6237\u7684\u6743\u9650\uff0c\u907f\u514d\u8fc7\u9ad8\u7684\u6743\u9650\u64cd\u4f5c\u3002<\/td><\/tr><tr><td><strong>\u8f93\u5165\u9a8c\u8bc1<\/strong><\/td><td>\u5bf9\u6240\u6709\u7528\u6237\u8f93\u5165\u8fdb\u884c\u683c\u5f0f\u9a8c\u8bc1\u548c\u8fc7\u6ee4\uff0c\u786e\u4fdd\u6570\u636e\u5408\u6cd5\u3002<\/td><\/tr><tr><td><strong>\u5b9a\u671f\u66f4\u65b0<\/strong><\/td><td>\u4fdd\u6301\u6570\u636e\u5e93\u548c PHP \u73af\u5883\u66f4\u65b0\uff0c\u907f\u514d\u5df2\u77e5\u7684\u5b89\u5168\u6f0f\u6d1e\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u9632\u6b62 SQL \u6ce8\u5165\u7684\u5173\u952e\u662f\uff1a <strong>\u6c38\u8fdc\u4e0d\u8981\u76f4\u63a5\u5c06\u7528\u6237\u8f93\u5165\u653e\u5165 SQL \u67e5\u8be2\u8bed\u53e5\u4e2d<\/strong>\u3002\u4f7f\u7528 <strong>\u9884\u5904\u7406\u8bed\u53e5<\/strong> \u548c <strong>\u53c2\u6570\u5316\u67e5\u8be2<\/strong> \u662f\u6700\u6709\u6548\u7684\u9632\u62a4\u624b\u6bb5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL \u6ce8\u5165\uff08SQL Injection\uff09\u662f\u4e00\u79cd\u5e38\u89c1\u7684 Web \u5b89\u9669\u6f0f\u6d1e\uff0c\u653b\u51fb\u8005&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2026\/01\/06\/php%e4%b8%ad%e9%98%b2sql%e6%b3%a8%e5%85%a5%e7%9a%84%e4%b8%bb%e8%a6%81%e6%96%b9%e6%b3%95\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1272","post","type-post","status-publish","format-standard","hentry","category-php"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=1272"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1272\/revisions"}],"predecessor-version":[{"id":1273,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1272\/revisions\/1273"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=1272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=1272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=1272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}