{"id":366,"date":"2006-02-16T14:14:38","date_gmt":"2006-02-16T05:14:38","guid":{"rendered":"http:\/\/terzeron.com\/?p=366"},"modified":"2006-02-16T14:14:38","modified_gmt":"2006-02-16T05:14:38","slug":"mysql%ec%9d%98-%ed%8a%b9%ec%a0%95-%ed%85%8c%ec%9d%b4%eb%b8%94-%ed%8a%b9%ec%a0%95-%ec%bb%ac%eb%9f%bc%ec%9d%98-%eb%ac%b8%ec%9e%90%ec%97%b4-%eb%b0%94%ea%be%b8%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/terzeron.com\/?p=366","title":{"rendered":"MySQL\uc758 \ud2b9\uc815 \ud14c\uc774\ube14\uc758 \ud2b9\uc815 \uceec\ub7fc\uc758 \ubb38\uc790\uc5f4 \uc77c\uad04 \uce58\ud658\ud558\uae30"},"content":{"rendered":"<pre class=\"brush: php\">&lt;html&gt;\n&lt;body&gt;\n&lt;?php\n$dbname = \"DB\uc774\ub984\";\n$userid = \"\uc720\uc800\uc544\uc774\ub514\";\n$passwd = \"\ud328\uc2a4\uc6cc\ub4dc\";\n$table = \"\ud14c\uc774\ube14\uc774\ub984\";\n$column = \"\uceec\ub7fc\uc774\ub984\";\n$old = \"\uae30\uc874 \ubb38\uc790\uc5f4\";\n$new = \"\uc0c8\ub85c\uc6b4 \ubb38\uc790\uc5f4\";\n$con = mysql_connect(\"localhost\", $userid, $passwd)\nor die (mysql_error());\nmysql_select_db($dbname);\n$query = \"select no, $column from $table where $column like '%\" . $old . \"%'\";\nprint \"query=$query&lt;br&gt;\\n\";\n$result = mysql_query($query, $con) or die (mysql_error());\n$total_size = mysql_num_rows($result);\nfor ($list = 0; $list < $total_size; $list++) {\nif (!($row = mysql_fetch_array($result))) {\nbreak;\n}\n$column_value = addslashes($row[$column]);\nprint \"$column ==> \" . htmlentities($column_value) . \"<br \/>\\n\";\n$query = \"update $table set $column = '\" . str_replace ($old, $new, $column_value) . \"' where no = \" . $row[no];\nprint \"query=\" . htmlentities($query) . \"&lt;br&gt;\\n\";\n$result = mysql_query($query, $con) or die (mysql_error());\n}\n?&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>replace.php\ub77c\ub294 \uc774\ub984\uc73c\ub85c \uc800\uc7a5\ud558\uace0 \uc6f9\uc73c\ub85c \uc774 \ud30c\uc77c\uc5d0 \uc811\uadfc\ud558\uba74 \ud2b9\uc815 \ud14c\uc774\ube14\uc758 \ud2b9\uc815 \uceec\ub7fc\uc5d0 \uc874\uc7ac\ud558\ub294 \ubaa8\ub4e0 \ubb38\uc790\uc5f4 \ud328\ud134\uc744 \ub2e4\ub978 \ubb38\uc790\uc5f4\ub85c \ubaa8\ub450 \ubcc0\uacbd\ud560 \uc218 \uc788\ub2e4.<\/p>\n<p>\uac8c\uc2dc\ud310\uc758 \ubcf8\ubb38 \uc911\uc5d0\uc11c \uc5b4\ub5a4 \ubb38\uc790\uc5f4\uc744 \uc77c\uad04 \uce58\ud658\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uc5d0 \uc720\uc6a9\ud558\ub2e4.<\/p>\n<div class=\"fb-background-color\">\n\t\t\t  <div \n\t\t\t  \tclass = \"fb-comments\" \n\t\t\t  \tdata-href = \"https:\/\/terzeron.com\/?p=366\"\n\t\t\t  \tdata-numposts = \"100\"\n\t\t\t  \tdata-lazy = \"true\"\n\t\t\t\tdata-colorscheme = \"light\"\n\t\t\t\tdata-order-by = \"time\"\n\t\t\t\tdata-mobile=true>\n\t\t\t  <\/div><\/div>\n\t\t  <style>\n\t\t    .fb-background-color {\n\t\t\t\tbackground: #ffffff !important;\n\t\t\t}\n\t\t\t.fb_iframe_widget_fluid_desktop iframe {\n\t\t\t    width: 100% !important;\n\t\t\t}\n\t\t  <\/style>\n\t\t  ","protected":false},"excerpt":{"rendered":"<p>&lt;html&gt; &lt;body&gt; &lt;?php $dbname = &#8220;DB\uc774\ub984&#8221;; $userid = &#8220;\uc720\uc800\uc544\uc774\ub514&#8221;; $passwd = &#8220;\ud328\uc2a4\uc6cc\ub4dc&#8221;; $table = &#8220;\ud14c\uc774\ube14\uc774\ub984&#8221;; $column = &#8220;\uceec\ub7fc\uc774\ub984&#8221;; $old = &#8220;\uae30\uc874 \ubb38\uc790\uc5f4&#8221;; $new = &#8220;\uc0c8\ub85c\uc6b4 \ubb38\uc790\uc5f4&#8221;; $con = mysql_connect(&#8220;localhost&#8221;, $userid, $passwd) or die (mysql_error()); mysql_select_db($dbname); $query = &#8220;select no, $column &hellip; <a href=\"https:\/\/terzeron.com\/?p=366\">\uacc4\uc18d \uc77d\uae30 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[14],"tags":[],"class_list":["post-366","post","type-post","status-publish","format-standard","hentry","category-unixlinux"],"_links":{"self":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=366"}],"version-history":[{"count":0,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/366\/revisions"}],"wp:attachment":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}