{"id":951,"date":"2003-09-15T01:53:55","date_gmt":"2003-09-15T01:53:55","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=951"},"modified":"2003-09-15T01:53:55","modified_gmt":"2003-09-15T01:53:55","slug":"mysql-%eb%8b%a4%ec%a4%91%ea%b2%80%ec%83%89","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=951","title":{"rendered":"mysql \ub2e4\uc911\uac80\uc0c9"},"content":{"rendered":"<p>\/\/ TEMPORARY TABLE MAKE<\/p>\n<p>$tmp_make=mysql_query(&#8220;create temporary table tmp (<\/p>\n<p>sid int NOT NULL DEFAULT &#8216;0&#8217; auto_increment,<\/p>\n<p>board varchar(20) NOT NULL,<\/p>\n<p>bid int(11) NOT NULL,<\/p>\n<p>subject varchar(255) NOT NULL,<\/p>\n<p>content text,<\/p>\n<p>signdate int(10) NOT NULL,<\/p>\n<p>PRIMARY KEY(sid)<\/p>\n<p>)&#8221;);<\/p>\n<p>\/\/ \uac8c\uc2dc\ud310 \ud658\uacbd \uc124\uc815 \ud14c\uc774\ube14\uc5d0\uc11c \uac01 \uac8c\uc2dc\ud310 BOARD \uac00\uc838\uc624\uae30<\/p>\n<p>$total_result =mysql_query(&#8220;select board from board_config where limit_user_level < $admin_level\");\n\n\n$board_total = mysql_num_rows($total_result);\n\n\n \n\n\n \n\n\n\/\/ BOARD \ubcc4\ub85c \uac8c\uc2dc\ud310 \ub3cc\uba74\uc11c \uac80\uc0c9\ud55c\ub2e4\n\n\nfor($i=0;$i<$board_total;$i++) {\n\n\nmysql_data_seek($total_result,$i);\n\n\n$board = mysql_fetch_array($total_result);\n\n\n$search=mysql_query(&#8220;select bid,subject,content,signdate from $board[board] where name like &#8216;%$key%&#8217; or subject like &#8216;%$key%&#8217; or content like &#8216;%$key%'&#8221;);\n\n\n$search_total=mysql_num_rows($search);\n\n\n \n\n\n\/\/ \uac80\uc0c9 \uacb0\uacfc\ub97c TEMPORARY \ud14c\uc774\ube14\uc5d0 \uc9d1\uc5b4 \ub123\ub294\ub2e4\n\n\nfor($j=0;$j<$search_total;$j++) {\n\n\nmysql_data_seek($search,$j);\n\n\n$row = mysql_fetch_array($search);\n\n\n$insert=mysql_query(&#8220;insert into tmp\n\n\n(board,bid,subject,content,signdate)\n\n\nvalues\n\n\n(&#8216;$board[board]&#8217;,&#8217;$row[bid]&#8217;,&#8217;$row[subject]&#8217;,&#8217;$row[content]&#8217;,&#8217;$row[subject]&#8217;)\n\n\n&#8220;); \n\n\n}\n\n\n}\n\n\n \n\n\n\/\/ TEMPORARY \ud14c\uc774\ube14 \uc815\ubcf4 \uac00\uc838\uc624\uae30\n\n\n$result=mysql_query(&#8220;select * from tmp order by signdate&#8221;);\n\n\n$total=mysql_num_rows($result);\n\n\n \n\n\necho &#8220;\n\n\n<center><\/p>\n<table border='0' cellpadding='2' cellspacing='2' width='90%'>\n<tr>\n<td colspan='10' align='right'>\n<p>\uac80 \uc0c9 \uc5b4 <font color='red'><b>$key<\/b><\/font> \ub85c <font color='red'><b>$total<\/b><\/font> \uac1c\uc758 \uac8c\uc2dc\ubb3c\uc774 \uac80\uc0c9 \ub418\uc5c8\uc2b5\ub2c8\ub2e4<\/p>\n<\/td>\n<\/tr>\n<p>&#8220;;<\/p>\n<p>\/\/ \ubcf4\uc5ec\uc8fc\uae30<\/p>\n<p>for($k=0;$k<$total;$k++) {\n\n\nmysql_data_seek($result,$k);\n\n\n$board=mysql_fetch_array($result);\n\n\n$board[subject]=stripslashes($board[subject]);\n\n\n$board[content]=stripslashes($board[content]);\n\n\n$board[content]= htmlspecialchars($board[content]);\n\n\n$board[signdate]=date(&#8220;Y\/m\/d&#8221;,$board[signdate]);\n\n\n$board[content] = shortenStr($board[content],200,&#8221;<br \/>more&#8230;..&#8221;);<\/p>\n<p>$board[subject] = shortenStr($board[subject],60,&#8221;&#8230;..&#8221;); <\/p>\n<p>$board[subject] = eregi_replace(&#8220;($key)&#8221;,&#8221;<font color='red'>1<\/font>&#8220;,$board[subject]);<\/p>\n<p>$board[content] = eregi_replace(&#8220;($key)&#8221;,&#8221;<font color='red'>1<\/font>&#8220;,$board[content]);<\/p>\n<p>echo &#8220;<\/p>\n<tr bgcolor='#006699'>\n<td height='25'>\n<p><font color='white'><b>$board[subject]<\/b> &#8212;&#8212;- $board[signdate]<\/font><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td height='40'>\n<p><a href='.\/cyboard\/board.php3?board=$board[board]&#038;bid=$board[bid]&#038;mode=reade&#038;key=$key'>$board[content]<\/a><\/p>\n<\/td>\n<\/tr>\n<p>&#8220;;<\/p>\n<p>}<\/p>\n<p>$drop=mysql_query(&#8220;drop table tmp&#8221;);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ TEMPORARY TABLE MAKE $tmp_make=mysql_query(&#8220;create temporary table tmp ( sid int NOT NULL DEFAULT &#8216;0&#8217; auto_increment, board varchar(20) NOT NULL, bid int(11) NOT NULL, subject varchar(255) NOT NULL, content text, signdate int(10) NOT NULL, PRIMARY KEY(sid) )&#8221;); \/\/ \uac8c\uc2dc\ud310 \ud658\uacbd \uc124\uc815 \ud14c\uc774\ube14\uc5d0\uc11c \uac01 \uac8c\uc2dc\ud310 BOARD \uac00\uc838\uc624\uae30 $total_result =mysql_query(&#8220;select board from board_config where limit_user_level < $admin_level\"); [&hellip;]\n<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-951","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=951"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/951\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}