{"id":2245,"date":"2014-09-15T15:50:45","date_gmt":"2014-09-15T06:50:45","guid":{"rendered":"http:\/\/www.happyfam.or.kr\/ysoh\/?p=2245"},"modified":"2016-06-01T11:35:36","modified_gmt":"2016-06-01T02:35:36","slug":"webdbii-%ec%8b%a4%ec%8a%b5%ec%98%88%ec%a0%9c-%ec%86%8c%ec%8a%a4-2","status":"publish","type":"post","link":"https:\/\/www.happyfam.or.kr\/ysoh\/webdbii-%ec%8b%a4%ec%8a%b5%ec%98%88%ec%a0%9c-%ec%86%8c%ec%8a%a4-2\/","title":{"rendered":"WebDB(II) \uc2e4\uc2b5\uc608\uc81c \uc18c\uc2a4 #2"},"content":{"rendered":"<pre class=\"wrap:true lang:php decode:true  \" title=\"examSQL-01.php\">&lt;?php\r\n\/\/ examSQL-01.php?a=test01&amp;c=\uc774\uc21c\uc2e0&amp;b=1234&amp;d=sslee@daum.net\r\n\r\nrequire '.\/dbConn.php';\r\n\r\n$link = mysqli_connect($dbHost, $dbUser, $dbPass); \/\/ MySQL \uc11c\ubc84 \uc5f0\uacb0\r\nmysqli_select_db($link, $dbName); \/\/ Database \uc120\ud0dd\r\nmysqli_set_charset($link, \"utf8\"); \/\/ DB \ubb38\uc790\uc14b \uc124\uc815\r\n\r\n$sql = \"INSERT INTO `user` VALUES ('{$_GET[\"a\"]}', '{$_GET[\"b\"]}', '{$_GET[\"c\"]}', '{$_GET[\"d\"]}')\";\r\necho $sql;\r\n\r\nmysqli_query($link, $sql); \/\/ SQL \uc2e4\ud589\r\nmysqli_close($link); \/\/ MySQL \uc5f0\uacb0 \uc885\ub8cc\r\n?&gt;<\/pre>\n<pre class=\"lang:php decode:true\" title=\"examSQL-02.php\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=\"UTF-8\"\/&gt;\r\n        &lt;title&gt;\uc785\ub825\ud3fc&lt;\/title&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;form method=\"post\" action=\"examSQL-03.php\"&gt;\r\n            \uc544\uc774\ub514 : &lt;input type=\"text\" name=\"a\" \/&gt;&lt;br\/&gt;\r\n            \ube44\ubc00\ubc88\ud638 : &lt;input type=\"password\" name=\"b\" \/&gt;&lt;br\/&gt;\r\n            \uc131\uba85 : &lt;input type=\"text\" name=\"c\" \/&gt;&lt;br\/&gt;\r\n            \uc774\uba54\uc77c : &lt;input type=\"text\" name=\"d\" \/&gt;&lt;br\/&gt;\r\n            &lt;input type=\"submit\" value=\"\ub4f1\ub85d\" \/&gt;\r\n        &lt;\/form&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<pre class=\"wrap:true lang:php decode:true \" title=\"examSQL-03.php\">&lt;?php\r\n\r\nrequire '.\/dbConn.php';\r\n\r\n$link = mysqli_connect($dbHost, $dbUser, $dbPass); \/\/ MySQL \uc11c\ubc84 \uc5f0\uacb0\r\nmysqli_select_db($link, $dbName); \/\/ Database \uc120\ud0dd\r\nmysqli_set_charset($link, \"utf8\"); \/\/ DB \ubb38\uc790\uc14b \uc124\uc815\r\n\r\n$sql = \"INSERT INTO `user` VALUES ('{$_POST[\"a\"]}', '{$_POST[\"b\"]}', '{$_POST[\"c\"]}', '{$_POST[\"d\"]}')\";\r\necho $sql;\r\n\r\nmysqli_query($link, $sql); \/\/ SQL \uc2e4\ud589\r\nmysqli_close($link); \/\/ MySQL \uc5f0\uacb0 \uc885\ub8cc\r\n?&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;?php \/\/ examSQL-01.php?a=test01&amp;c=\uc774\uc21c\uc2e0&amp;b=1234&amp;d=sslee@daum.net require &#8216;.\/dbConn.php&#8217;; $link = mysqli_connect($dbHost, $dbUser, $dbPass); \/\/ MySQL \uc11c\ubc84 \uc5f0\uacb0 mysqli_select_db($link, $dbName); \/\/ Database \uc120\ud0dd mysqli_set_charset($link, &#8220;utf8&#8221;); \/\/ DB \ubb38\uc790\uc14b \uc124\uc815 $sql = &#8220;INSERT INTO `user` VALUES (&#8216;{$_GET[&#8220;a&#8221;]}&#8217;, &#8216;{$_GET[&#8220;b&#8221;]}&#8217;, &#8216;{$_GET[&#8220;c&#8221;]}&#8217;, &#8216;{$_GET[&#8220;d&#8221;]}&#8217;)&#8221;; echo $sql; mysqli_query($link, $sql); \/\/ SQL \uc2e4\ud589 mysqli_close($link); \/\/ MySQL \uc5f0\uacb0 \uc885\ub8cc ?&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=&#8221;UTF-8&#8243;\/&gt; &lt;title&gt;\uc785\ub825\ud3fc&lt;\/title&gt;\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.happyfam.or.kr\/ysoh\/webdbii-%ec%8b%a4%ec%8a%b5%ec%98%88%ec%a0%9c-%ec%86%8c%ec%8a%a4-2\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[134,2],"tags":[233,21,34,40,53],"class_list":["post-2245","post","type-post","status-publish","format-standard","hentry","category-webdbii","category-2","tag-database","tag-html","tag-mysql","tag-php","tag-webdb"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p776QY-Ad","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/posts\/2245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/comments?post=2245"}],"version-history":[{"count":0,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/posts\/2245\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/media?parent=2245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/categories?post=2245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/tags?post=2245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}