{"id":1233,"date":"2024-11-22T11:05:57","date_gmt":"2024-11-22T11:05:57","guid":{"rendered":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233"},"modified":"2024-11-22T11:05:58","modified_gmt":"2024-11-22T11:05:58","slug":"php-mysql-andmebaasiga-sidumine","status":"publish","type":"page","link":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233","title":{"rendered":"PHP\/MySQL andmebaasiga sidumine"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li>Connect <\/li>\n<\/ol>\n\n\n\n<p>\u042f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u043e\u043d\u0435\u043a\u0442 \u0442\u0430\u043a:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"551\" height=\"154\" src=\"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15.png\" alt=\"\" class=\"wp-image-1235\" srcset=\"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15.png 551w, https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15-300x84.png 300w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/figure>\n\n\n\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0411\u0414 \u0432 xampp, \u043f\u043e\u0442\u043e\u043c \u0432 phpstorm \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"752\" src=\"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-16.png\" alt=\"\" class=\"wp-image-1236\" srcset=\"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-16.png 790w, https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-16-300x286.png 300w, https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-16-768x731.png 768w, https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-16-624x594.png 624w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/figure>\n\n\n\n<p>2) SELECT <\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" 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;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\/\/tabeli sisu kuvamine\n$paring = $yhendus-&gt;prepare(&quot;SELECT id, nimi, telefon, pilt, synniaeg FROM osalejad&quot;);\n$paring-&gt;bind_result($id, $nimi, $telefon, $pilt, $synniaeg);\n$paring-&gt;execute();\n?&gt;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><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 nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">\/\/tabeli sisu kuvamine<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">paring<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">yhendus<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">prepare<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">SELECT<\/span><span style=\"color: #A3BE8C\"> id, nimi, telefon, pilt, synniaeg <\/span><span style=\"color: #81A1C1\">FROM<\/span><span style=\"color: #A3BE8C\"> osalejad<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">paring<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">bind_result<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">id<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">nimi<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">telefon<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">pilt<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">synniaeg<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">paring<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">execute<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">?&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u044f \u0432\u044b\u0432\u043e\u0436\u0443 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 SELECT \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438<\/p>\n\n\n\n<p>3) INSERT, DELETE<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" 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;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\/\/tabeli andmete lisamine\nif (isset($_REQUEST[&quot;nimi&quot;]) &amp;&amp; !empty($_REQUEST[&quot;nimi&quot;])) {\n    $paring = $yhendus-&gt;prepare(&quot;INSERT INTO osalejad(nimi, telefon, pilt, synniaeg) VALUES (?,?,?,?)&quot;);\n    $paring-&gt;bind_param(&quot;ssss&quot;, $_REQUEST[&quot;nimi&quot;], $_REQUEST[&quot;telefon&quot;], $_REQUEST[&quot;pilt&quot;], $_REQUEST[&quot;synniaeg&quot;]);\n    $paring-&gt;execute();\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><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 nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">\/\/tabeli andmete lisamine<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">isset<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">nimi<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">])<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&amp;&amp;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">!empty<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">nimi<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">]))<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">paring<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">yhendus<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">prepare<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">INSERT INTO<\/span><span style=\"color: #A3BE8C\"> osalejad(nimi, telefon, pilt, synniaeg) <\/span><span style=\"color: #81A1C1\">VALUES<\/span><span style=\"color: #A3BE8C\"> (?,?,?,?)<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">paring<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">bind_param<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">ssss<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">nimi<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">],<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">telefon<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">],<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">pilt<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">],<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">synniaeg<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">])<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">paring<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">execute<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 INSERT \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u043e\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435 VALUES \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u0435\u0439. &#8220;SSSS&#8221; \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 string \u0444\u043e\u0440\u043c\u0430\u0442\u0430<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" 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;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"if (isset($_REQUEST[&quot;kustuta&quot;])) {\n    $kask = $yhendus-&gt;prepare(&quot;DELETE FROM osalejad WHERE id=?&quot;);\n    $kask-&gt;bind_param(&quot;i&quot;, $_REQUEST[&quot;kustuta&quot;]);\n    $kask-&gt;execute();\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><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 nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">isset<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">kustuta<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">]))<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">kask<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">yhendus<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">prepare<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">DELETE<\/span><span style=\"color: #A3BE8C\"> <\/span><span style=\"color: #81A1C1\">FROM<\/span><span style=\"color: #A3BE8C\"> osalejad <\/span><span style=\"color: #81A1C1\">WHERE<\/span><span style=\"color: #A3BE8C\"> id<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #A3BE8C\">?<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">kask<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">bind_param<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">i<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_REQUEST<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">kustuta<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">])<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">kask<\/span><span style=\"color: #81A1C1\">-&gt;<\/span><span style=\"color: #88C0D0\">execute<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0412 DELETE \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 DELETE FROM \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c, \u0430 \u043f\u043e\u0441\u043b\u0435 WHERE \u0430\u0439\u0434\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u043a\u0430\u043a\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u043e\u043d\u0435\u043a\u0442 \u0442\u0430\u043a: \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0411\u0414 \u0432 xampp, \u043f\u043e\u0442\u043e\u043c \u0432 phpstorm \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435: 2) SELECT \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u044f \u0432\u044b\u0432\u043e\u0436\u0443 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 SELECT \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 3) INSERT, DELETE \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 INSERT \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u043e\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435 VALUES [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1233","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP\/MySQL andmebaasiga sidumine - Kirill Sats &otilde;pimapp | portfoolio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233\" \/>\n<meta property=\"og:locale\" content=\"et_EE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP\/MySQL andmebaasiga sidumine - Kirill Sats &otilde;pimapp | portfoolio\" \/>\n<meta property=\"og:description\" content=\"\u042f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u043e\u043d\u0435\u043a\u0442 \u0442\u0430\u043a: \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0411\u0414 \u0432 xampp, \u043f\u043e\u0442\u043e\u043c \u0432 phpstorm \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435: 2) SELECT \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u044f \u0432\u044b\u0432\u043e\u0436\u0443 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 SELECT \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 3) INSERT, DELETE \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 INSERT \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u043e\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435 VALUES [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233\" \/>\n<meta property=\"og:site_name\" content=\"Kirill Sats &otilde;pimapp | portfoolio\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-22T11:05:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15.png\" \/>\n\t<meta property=\"og:image:width\" content=\"551\" \/>\n\t<meta property=\"og:image:height\" content=\"154\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233\",\"url\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233\",\"name\":\"PHP\\\/MySQL andmebaasiga sidumine - Kirill Sats &otilde;pimapp | portfoolio\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image-15.png\",\"datePublished\":\"2024-11-22T11:05:57+00:00\",\"dateModified\":\"2024-11-22T11:05:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233#breadcrumb\"},\"inLanguage\":\"et\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"et\",\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233#primaryimage\",\"url\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image-15.png\",\"contentUrl\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image-15.png\",\"width\":551,\"height\":154},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?page_id=1233#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\\\/MySQL andmebaasiga sidumine\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/#website\",\"url\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/\",\"name\":\"Kirill Sats &otilde;pimapp | portfoolio\",\"description\":\"Noorem Tarkvaarendaja eriala\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kirillsats23.thkit.ee\\\/wp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"et\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP\/MySQL andmebaasiga sidumine - Kirill Sats &otilde;pimapp | portfoolio","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233","og_locale":"et_EE","og_type":"article","og_title":"PHP\/MySQL andmebaasiga sidumine - Kirill Sats &otilde;pimapp | portfoolio","og_description":"\u042f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u043e\u043d\u0435\u043a\u0442 \u0442\u0430\u043a: \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0411\u0414 \u0432 xampp, \u043f\u043e\u0442\u043e\u043c \u0432 phpstorm \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435: 2) SELECT \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u044f \u0432\u044b\u0432\u043e\u0436\u0443 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 SELECT \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 3) INSERT, DELETE \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 INSERT \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u043e\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435 VALUES [&hellip;]","og_url":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233","og_site_name":"Kirill Sats &otilde;pimapp | portfoolio","article_modified_time":"2024-11-22T11:05:58+00:00","og_image":[{"width":551,"height":154,"url":"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233","url":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233","name":"PHP\/MySQL andmebaasiga sidumine - Kirill Sats &otilde;pimapp | portfoolio","isPartOf":{"@id":"https:\/\/kirillsats23.thkit.ee\/wp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233#primaryimage"},"image":{"@id":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233#primaryimage"},"thumbnailUrl":"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15.png","datePublished":"2024-11-22T11:05:57+00:00","dateModified":"2024-11-22T11:05:58+00:00","breadcrumb":{"@id":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233#breadcrumb"},"inLanguage":"et","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233"]}]},{"@type":"ImageObject","inLanguage":"et","@id":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233#primaryimage","url":"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15.png","contentUrl":"https:\/\/kirillsats23.thkit.ee\/wp\/wp-content\/uploads\/2024\/11\/image-15.png","width":551,"height":154},{"@type":"BreadcrumbList","@id":"https:\/\/kirillsats23.thkit.ee\/wp\/?page_id=1233#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kirillsats23.thkit.ee\/wp\/"},{"@type":"ListItem","position":2,"name":"PHP\/MySQL andmebaasiga sidumine"}]},{"@type":"WebSite","@id":"https:\/\/kirillsats23.thkit.ee\/wp\/#website","url":"https:\/\/kirillsats23.thkit.ee\/wp\/","name":"Kirill Sats &otilde;pimapp | portfoolio","description":"Noorem Tarkvaarendaja eriala","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kirillsats23.thkit.ee\/wp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"et"}]}},"_links":{"self":[{"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=\/wp\/v2\/pages\/1233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1233"}],"version-history":[{"count":1,"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=\/wp\/v2\/pages\/1233\/revisions"}],"predecessor-version":[{"id":1237,"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=\/wp\/v2\/pages\/1233\/revisions\/1237"}],"wp:attachment":[{"href":"https:\/\/kirillsats23.thkit.ee\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}