{"id":539,"date":"2010-10-31T20:56:35","date_gmt":"2010-10-31T20:56:35","guid":{"rendered":""},"modified":"2010-10-31T20:56:35","modified_gmt":"2010-10-31T20:56:35","slug":"539","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=539","title":{"rendered":"\u8ba9php\u81ea\u52a8\u8bc6\u522b\u94fe\u63a5\u8fdc\u7a0b\u6570\u636e\u5e93\u6216\u672c\u5730\u6570\u636e\u5e93"},"content":{"rendered":"<p>\u6d4b\u8bd5\u7528\u4f8b\uff1a<br \/>\u4ec5\u4f9b\u53c2\u8003\uff1a<br \/><code><br \/>&lt;?php<br \/>\/\/ \u5305\u542bMysql\u64cd\u4f5c\u7c7b <br \/>include_once 'mysql.class.php';<br \/>\/\/ \u672c\u5730mysql\u6570\u636e<br \/>$mysql_local_data = array('db_user'=&gt;'root', <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'db_pass'=&gt;'root', <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'db_name'=&gt;'mysql');<br \/>\/\/ \u8fdc\u7a0bmysql\u6570\u636e<br \/>$mysql_remote_data = array('db_user'=&gt;'xxx', <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'db_pass'=&gt;'xxx', <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'db_name'=&gt;'xxx');<br \/>\/\/ \u516c\u7528\u6570\u636e<br \/>$db_host&nbsp;&nbsp;&nbsp;&nbsp;= 'localhost';<br \/>$tb_prefix&nbsp;&nbsp;= 'wz_';<br \/>$db_charset = 'GBK';<br \/>\/\/\u672c\u5730\u8fde\u63a5\u6210\u529f\u5219\u5b9e\u4f8b\u5316\u672c\u5730Mysql\u7c7b\uff0c\u5426\u5219\u8fde\u63a5\u8fdc\u7a0b\u6570\u636e\u5e93\u5e76\u5b9e\u4f8b\u5316Mysql\u7c7b<br \/>if (@mysql_connect($db_host, $mysql_local_data[db_user], $mysql_local_data[db_pass]))<br \/> $db = new Mysql($db_host, $mysql_local_data[db_user], $mysql_local_data[db_pass], $mysql_local_data[db_name], $db_charset, $conn);<br \/>else <br \/> $db = new Mysql($db_host, $mysql_remote_data[db_user], $mysql_remote_data[db_pass], $mysql_remote_data[db_name], $db_charset, $conn);<br \/>$db-&gt;show_tables();<br \/>?&gt;<br \/><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d4b\u8bd5\u7528\u4f8b\uff1a\u4ec5\u4f9b\u53c2\u8003\uff1a&lt;?php\/\/ \u5305\u542bMysql\u64cd\u4f5c\u7c7b in&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-539","post","type-post","status-publish","format-standard","hentry","category-Php"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=539"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/539\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}