{"id":834,"date":"2025-08-05T16:23:50","date_gmt":"2025-08-05T07:23:50","guid":{"rendered":"https:\/\/nexive.tech\/?p=834"},"modified":"2025-08-05T16:23:50","modified_gmt":"2025-08-05T07:23:50","slug":"%e3%80%90%e3%82%b5%e3%82%af%e3%83%83%e3%81%a8%e8%a7%a3%e8%aa%ac%e3%80%91php%e3%81%a7%e3%81%aeinsert%e3%83%bbupdate%e3%83%bbdelete%e3%81%ae%e5%9f%ba%e6%9c%ac%e6%a7%8b%e6%96%87%e3%81%a8%e5%ae%89","status":"publish","type":"post","link":"https:\/\/nexive.tech\/?p=834","title":{"rendered":"\u3010\u30b5\u30af\u30c3\u3068\u89e3\u8aac\u3011PHP\u3067\u306eINSERT\u30fbUPDATE\u30fbDELETE\u306e\u57fa\u672c\u69cb\u6587\u3068\u5b89\u5168\u306a\u5b9f\u884c\u65b9\u6cd5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP\u304b\u3089MySQL\u306b\u5bfe\u3059\u308bINSERT\u30fbUPDATE\u30fbDELETE\u306e\u57fa\u672c\u69cb\u6587\u3092\u89e3\u8aac<\/li>\n\n\n\n<li>PDO\u306b\u3088\u308bSQL\u5b9f\u884c\u306e\u5b89\u5168\u306a\u66f8\u304d\u65b9\u3068\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u306e\u4f7f\u3044\u65b9\u3092\u7d39\u4ecb<\/li>\n\n\n\n<li>\u5b9f\u52d9\u4e0a\u306e\u6ce8\u610f\u70b9\u3084\u5178\u578b\u7684\u306a\u30df\u30b9\u3082\u88dc\u8db3<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. PHP\u306eINSERT\u30fbUPDATE\u30fbDELETE\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>PHP\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c\u3092\u884c\u3046\u969b\u3001INSERT\u30fbUPDATE\u30fbDELETE\u306f\u300c\u30c7\u30fc\u30bf\u306e\u767b\u9332\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u300d\u3092\u62c5\u3046\u57fa\u672c\u7684\u306aSQL\u547d\u4ee4\u3067\u3059\u3002\u3053\u308c\u3089\u3092\u9069\u5207\u306b\u6271\u3046\u3053\u3068\u3067\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u7ba1\u7406\u6a5f\u80fd\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001PDO\uff08PHP Data Objects\uff09\u3092\u4f7f\u3063\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u304c\u63a8\u5968\u3055\u308c\u3066\u304a\u308a\u3001SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u7b56\u3068\u3057\u3066\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u306e\u4f7f\u7528\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3068\u3048\u3070\u3001\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30c7\u30fc\u30bf\u3092DB\u306b\u683c\u7d0d\u3057\u305f\u308a\u3001\u7de8\u96c6\u6a5f\u80fd\u3067\u7279\u5b9a\u30ec\u30b3\u30fc\u30c9\u3092\u66f4\u65b0\u3057\u305f\u308a\u3001\u524a\u9664\u30dc\u30bf\u30f3\u3067\u30a8\u30f3\u30c8\u30ea\u3092\u6d88\u3057\u305f\u308a\u3068\u3001INSERT\u30fbUPDATE\u30fbDELETE\u306fCRUD\u64cd\u4f5c\u306e\u4e2d\u5fc3\u7684\u306a\u5b58\u5728\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u8a73\u7d30\u89e3\u8aac<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">3.1 \u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\uff08INSERT\uff09\u3059\u308b<\/h3>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3084\u8a18\u4e8b\u6295\u7a3f\u306a\u3069\u3001\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092DB\u306b\u767b\u9332\u3059\u308b\u969b\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/\/ \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\n$pdo = new PDO('mysql:host=localhost;dbname=testdb', 'user', 'pass');\n\n\/\/ SQL\u6587\u3092\u7528\u610f\n$sql = \"INSERT INTO users (name, email) VALUES (:name, :email)\";\n$stmt = $pdo->prepare($sql);\n\n\/\/ \u5024\u3092\u30d0\u30a4\u30f3\u30c9\u3057\u3066\u5b9f\u884c\n$stmt->execute(&#91;\n    ':name' => '\u7530\u4e2d\u592a\u90ce',\n    ':email' => 'taro@example.com'\n&#93;);\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$pdo<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #569CD6\">new<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">PDO<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&#39;mysql:host=localhost;dbname=testdb&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&#39;user&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&#39;pass&#39;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ SQL\u6587\u3092\u7528\u610f<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$sql<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #569CD6\">INSERT INTO<\/span><span style=\"color: #CE9178\"> users (<\/span><span style=\"color: #569CD6\">name<\/span><span style=\"color: #CE9178\">, email) <\/span><span style=\"color: #569CD6\">VALUES<\/span><span style=\"color: #CE9178\"> (:<\/span><span style=\"color: #569CD6\">name<\/span><span style=\"color: #CE9178\">, :email)&quot;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$stmt<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">$pdo<\/span><span style=\"color: #D4D4D4\">-&gt;<\/span><span style=\"color: #DCDCAA\">prepare<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$sql<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u5024\u3092\u30d0\u30a4\u30f3\u30c9\u3057\u3066\u5b9f\u884c<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$stmt<\/span><span style=\"color: #D4D4D4\">-&gt;<\/span><span style=\"color: #DCDCAA\">execute<\/span><span style=\"color: #D4D4D4\">(&#91;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #CE9178\">&#39;:name&#39;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #CE9178\">&#39;\u7530\u4e2d\u592a\u90ce&#39;<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #CE9178\">&#39;:email&#39;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #CE9178\">&#39;taro@example.com&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">&#93;);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u51fa\u529b\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u6210\u529f\u3059\u308b\u30681\u4ef6\u306e\u30c7\u30fc\u30bf\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3.2 \u30c7\u30fc\u30bf\u3092\u66f4\u65b0\uff08UPDATE\uff09\u3059\u308b<\/h3>\n\n\n\n<p>\u65e2\u5b58\u30ec\u30b3\u30fc\u30c9\u306e\u4e00\u90e8\u60c5\u5831\u3092\u5909\u66f4\u3059\u308b\u51e6\u7406\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$sql = \"UPDATE users SET email = :email WHERE name = :name\";\n$stmt = $pdo->prepare($sql);\n$stmt->execute(&#91;\n    ':email' => 'new@example.com',\n    ':name' => '\u7530\u4e2d\u592a\u90ce'\n&#93;);\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">$sql<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #569CD6\">UPDATE<\/span><span style=\"color: #CE9178\"> users <\/span><span style=\"color: #569CD6\">SET<\/span><span style=\"color: #CE9178\"> email <\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\"> :email <\/span><span style=\"color: #569CD6\">WHERE<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #569CD6\">name<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\"> :<\/span><span style=\"color: #569CD6\">name<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$stmt<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">$pdo<\/span><span style=\"color: #D4D4D4\">-&gt;<\/span><span style=\"color: #DCDCAA\">prepare<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$sql<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$stmt<\/span><span style=\"color: #D4D4D4\">-&gt;<\/span><span style=\"color: #DCDCAA\">execute<\/span><span style=\"color: #D4D4D4\">(&#91;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #CE9178\">&#39;:email&#39;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #CE9178\">&#39;new@example.com&#39;<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #CE9178\">&#39;:name&#39;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #CE9178\">&#39;\u7530\u4e2d\u592a\u90ce&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">&#93;);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><code>WHERE<\/code>\u53e5\u3092\u7701\u7565\u3059\u308b\u3068\u5168\u30ec\u30b3\u30fc\u30c9\u304c\u66f4\u65b0\u3055\u308c\u308b\u305f\u3081\u3001\u5fc5\u305a\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3.3 \u30c7\u30fc\u30bf\u3092\u524a\u9664\uff08DELETE\uff09\u3059\u308b<\/h3>\n\n\n\n<p>\u4e0d\u8981\u306b\u306a\u3063\u305f\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3059\u308b\u969b\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$sql = \"DELETE FROM users WHERE name = :name\";\n$stmt = $pdo->prepare($sql);\n$stmt->execute(&#91;':name' => '\u7530\u4e2d\u592a\u90ce'&#93;);\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">$sql<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #569CD6\">DELETE<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #569CD6\">FROM<\/span><span style=\"color: #CE9178\"> users <\/span><span style=\"color: #569CD6\">WHERE<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #569CD6\">name<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\"> :<\/span><span style=\"color: #569CD6\">name<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$stmt<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">$pdo<\/span><span style=\"color: #D4D4D4\">-&gt;<\/span><span style=\"color: #DCDCAA\">prepare<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$sql<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$stmt<\/span><span style=\"color: #D4D4D4\">-&gt;<\/span><span style=\"color: #DCDCAA\">execute<\/span><span style=\"color: #D4D4D4\">(&#91;<\/span><span style=\"color: #CE9178\">&#39;:name&#39;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #CE9178\">&#39;\u7530\u4e2d\u592a\u90ce&#39;<\/span><span style=\"color: #D4D4D4\">&#93;);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>UPDATE\u3068\u540c\u69d8\u3001DELETE\u3082\u6761\u4ef6\u6307\u5b9a\u3092\u6020\u308b\u3068\u5168\u4ef6\u524a\u9664\u306b\u306a\u308b\u30ea\u30b9\u30af\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u3088\u304f\u3042\u308b\u30df\u30b9\u30fb\u8aa4\u89e3\u30fb\u843d\u3068\u3057\u7a74<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u3092\u4f7f\u308f\u305a\u306b\u6587\u5b57\u5217\u3092\u76f4\u63a5SQL\u306b\u57cb\u3081\u8fbc\u3080\u3068\u3001SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u306e\u5371\u967a\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>WHERE<\/code>\u53e5\u3092\u7701\u7565\u3057\u305fUPDATE\/DELETE\u306f\u3001<strong>\u5168\u4ef6\u304c\u5bfe\u8c61<\/strong>\u3068\u306a\u308b\u305f\u3081\u3001\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306a\u3057\u306e\u5b9f\u884c\u306f\u5371\u967a\u3067\u3059\u3002<\/li>\n\n\n\n<li><code>$stmt-&gt;execute()<\/code>\u5f8c\u306e\u623b\u308a\u5024\u306f<code>true\/false<\/code>\u3067\u3001\u4ef6\u6570\u53d6\u5f97\u306b\u306f<code>rowCount()<\/code>\u3092\u7528\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u306b\u306f\u300c:key\u300d\u5f62\u5f0f\u306e\u547d\u540d\u304c\u5fc5\u8981\u3067\u3001\u5bfe\u5fdc\u3059\u308b\u914d\u5217\u306e\u30ad\u30fc\u3068\u3082\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u307e\u3068\u3081<\/h2>\n\n\n\n<p>PHP\u3067INSERT\u30fbUPDATE\u30fbDELETE\u3092\u5b89\u5168\u306b\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001PDO\u3092\u4f7f\u3063\u305f\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u306e\u6d3b\u7528\u304c\u91cd\u8981\u3067\u3059\u3002\u6761\u4ef6\u4ed8\u304d\u306eSQL\u5b9f\u884c\u3084\u30d0\u30a4\u30f3\u30c9\u51e6\u7406\u306b\u6163\u308c\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7279\u306bUPDATE\u3084DELETE\u3067\u306f\u3001<code>WHERE<\/code>\u53e5\u306e\u6307\u5b9a\u30df\u30b9\u304c\u91cd\u5927\u306a\u4e8b\u6545\u306b\u3064\u306a\u304c\u308b\u305f\u3081\u3001\u5fc5\u305a\u4e8b\u524d\u30c1\u30a7\u30c3\u30af\u3084\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3067\u306e\u691c\u8a3c\u3092\u884c\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8 2. PHP\u306eINSERT\u30fbUPDATE\u30fbDELETE\u3068\u306f\uff1f PHP\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c\u3092\u884c\u3046\u969b\u3001INSERT\u30fbUPDATE\u30fbDELETE\u306f\u300c\u30c7\u30fc\u30bf\u306e\u767b\u9332\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u300d\u3092\u62c5\u3046\u57fa\u672c\u7684\u306aSQL\u547d\u4ee4\u3067\u3059\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":912,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[85],"tags":[],"class_list":["post-834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=834"}],"version-history":[{"count":2,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":913,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions\/913"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/media\/912"}],"wp:attachment":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}