{"id":246,"date":"2013-08-12T21:37:24","date_gmt":"2013-08-12T21:37:24","guid":{"rendered":"http:\/\/blog.yyhcw.com\/post\/246.html"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T07:54:17","slug":"EZSQL-show","status":"publish","type":"post","link":"http:\/\/blog.yyhcw.com\/post\/246.html","title":{"rendered":"\u6570\u636e\u5e93\u64cd\u7c7bEZSQL\u8be6\u7ec6\u4ecb\u7ecd"},"content":{"rendered":"<p>\u3000\u3000\u4eca\u5929\u5728\u67e5\u770b\u6613\u4f01\uff23\uff2dS\u7684\u65f6\u5019\u5728\u91cc\u9762\u53d1\u73b0\u4e00\u4e2aEZSQL\u6570\u636e\u5e93\u64cd\u4f5c\u7c7b\uff01\u597d\u5947\u4e4b\u5fc3\u641c\u5bfb\u4e86\u4e0b\uff0c\u53d1\u73b0\u662f\u4e2a\u5f88\u4e0d\u9519\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u7c7b\u5e93\uff0c\u5c31\u8fde\u5927\u540d\u9f0e\u9f0e\u7684Wordpress\u4e5f\u4f7f\u7528\u6b64\u7c7b\u5e93\uff01\u4e8e\u662f\u7f51\u4e0a\u6536\u96c6\u6574\u7406\u4e0b\uff0c\u5177\u4f53\u529f\u80fd\u4ecb\u7ecd\u5982\u4e0b\uff1a<\/p>\n<p><strong>EZSQL\u7c7b\u4ecb\u7ecd<\/strong>\uff1a<\/p>\n<p>ezsql\u662f\u4e00\u4e2a\u5c0f\u578b\u7684\u5feb\u901f\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u7c7b\uff0c\u53ef\u4ee5\u8ba9\u4f60\u5f88\u5bb9\u6613\u5730\u7528PHP\u64cd\u4f5c\u5404\u79cd\u6570\u636e\u5e93\uff08 MySQL\u3001oracle8\/9 \u3001interbase\u3001FireBird\u3001PostgreSQL\u3001MS-SQL\u3001sqlite\u3001sqlite C++\uff09\u3002<\/p>\n<p>\u5728\u4f60\u7684\u811a\u672c\u5f00\u5934\u662f\u8981\u5305\u542b\u4e00\u4e2a\u4e00\u4e2aPHP\u6587\u4ef6\u3002\u7136\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u4f7f\u7528\u66f4\u5c0f\u3001\u66f4\u5bb9\u6613\u7684\u4e00\u5957ezsql\u51fd\u6570\u6765\u4ee3\u66ff\u6807\u51c6\u7684PHP\u6570\u636e\u5e93\u51fd\u6570\u3002<\/p>\n<p>\u5b83\u4f1a\u81ea\u52a8\u7f13\u5b58\u7684\u67e5\u8be2\u7ed3\u679c\uff0c\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7b80\u5355\u7684\u51fd\u6570\u64cd\u4f5c\u53ca\u6269\u5c55\uff0c\u5e76\u4e14\u6ca1\u6709\u9020\u6210\u989d\u5916\u7684\u670d\u52a1\u5668\u5f00\u9500<\/p>\n<p>\u5b83\u5177\u6709\u4f18\u826f\u7684\u8c03\u8bd5\u529f\u80fd\uff0c\u4f7f\u4f60\u5feb\u901f\u7684\u5224\u65adSQL\u8bed\u53e5\u7684\u6267\u884c\u8fc7\u7a0b<\/p>\n<p>ezsql\u51fd\u6570\u53ef\u4ee5\u8fd4\u56de\u7684\u7ed3\u679c\u662f\u5bf9\u8c61\uff0c\u5173\u8054\u6570\u7ec4\uff0c\u6216\u6570\u503c\u6570\u7ec4<\/p>\n<p>\u5b83\u53ef\u4ee5\u5927\u5927\u7f29\u77ed\u5f00\u53d1\u65f6\u95f4\uff0c\u5e76\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5c06\u7b80\u5316\u60a8\u7684\u4ee3\u7801\uff0c\u8ba9\u5176\u8dd1\u5f97\u66f4\u5feb\uff0c\u4ee5\u53ca\u5f88\u5bb9\u6613\u8c03\u8bd5\u548c\u4f18\u5316\u60a8\u7684\u6570\u636e\u5e93\u67e5\u8be2\u8bed\u53e5\u3002<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5c0f\u7c7b\uff0c\u5728\u4f60\u7684\u7f51\u7ad9\u4e0a\u5e76\u4e0d\u4f1a\u589e\u52a0\u5f88\u5927\u7684\u5f00\u9500\u3002<\/p>\n<p><\/p>\n<p>\u7c7b\u4e2d\u6709\u4ee5\u4e0b\u7684\u65b9\u6cd5\uff1a<\/p>\n<p><\/p>\n<p>- $db-&gt;get_results \u2013 \u4ece\u6570\u636e\u5e93\u4e2d\u8bfb\u53d6\u6570\u636e\u96c6 (or \u4e4b\u524d\u7f13\u5b58\u7684\u6570\u636e\u96c6)<\/p>\n<p>- $db-&gt;get_row \u2014 \u4ece\u6570\u636e\u5e93\u4e2d\u8bfb\u53d6\u4e00\u6761\u6570\u636e (or \u4e4b\u524d\u7f13\u5b58\u7684\u6570\u636e)<\/p>\n<p>- $db-&gt;get_col \u2013 \u4ece\u6570\u636e\u5e93\u4e2d\u8bfb\u53d6\u4e00\u5217\u6307\u5b9a\u6570\u636e\u96c6 (or \u4e4b\u524d\u7f13\u5b58\u7684\u6570\u636e\u96c6)<\/p>\n<p>- $db-&gt;get_var \u2014 \u4ece\u6570\u636e\u5e93\u6570\u636e\u96c6\u4e2d\u8bfb\u53d6\u4e00\u4e2a\u503c (or \u4e4b\u524d\u7f13\u5b58\u7684\u6570\u636e)<\/p>\n<p>- $db-&gt;query \u2014 \u6267\u884c\u4e00\u6761sql\u8bed\u53e5(\u5982\u679c\u6709\u6570\u636e\uff0c\u5c31\u7f13\u5b58\u8d77\u6765)<\/p>\n<p>- $db-&gt;debug \u2013 \u6253\u5370\u6700\u540e\u6267\u884c\u7684sql\u8bed\u53e5\u4e0e\u8fd4\u56de\u7684\u7ed3\u679c\uff08\u5982\u679c\u6709\u7ed3\u679c\uff09<\/p>\n<p>- $db-&gt;vardump \u2013 \u6253\u5370\u53d8\u91cf\u7684\u7ed3\u6784\u53ca\u5185\u5bb9<\/p>\n<p>- $db-&gt;select \u2014 \u9009\u62e9\u4e00\u4e2a\u65b0\u6570\u636e\u5e93<\/p>\n<p>- $db-&gt;get_col_info \u2013 \u83b7\u53d6\u5217\u7684\u4fe1\u606f<\/p>\n<p>- $db-&gt;donation \u2013 \u6350\u94b1\u7ed9\u4f5c\u8005\u7528\u7684<\/p>\n<p>- $db-&gt;escape \u2013 \u683c\u5f0f\u5316\u63d2\u5165\u6570\u636e\u5e93\u7684\u5b57\u7b26\u4e32\uff0ceg:mysql_escape_string(stripslashes($str))<\/p>\n<p>- $db-&gt;flush \u2013 \u6e05\u9664\u7f13\u5b58<\/p>\n<p>- $db-&gt;get_cache \u2013 \u6362\u53d6\u7f13\u5b58<\/p>\n<p>- $db-&gt;hide_errors \u2013 \u9690\u85cf\u9519\u8bef<\/p>\n<p>- $db-&gt;register_error \u2013 \u6ce8\u518c\u9519\u8bef<\/p>\n<p>- $db-&gt;show_errors \u2013 \u663e\u793a\u9519\u8bef<\/p>\n<p>- $db-&gt;store_cache \u2013 \u5b58\u50a8\u5230\u7f13\u5b58<\/p>\n<p>- $db-&gt;sysdate \u2013 \u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4<\/p>\n<p>- $db = new db \u2014 \u5efa\u7acb\u4e00\u4e2a\u65b0db\u5bf9\u8c61.<\/p>\n<p><\/p>\n<p>\u5176\u4ed6\u8fd8\u6709\u4e00\u4e9b\u51fd\u6570\uff0c\u8fd9\u91cc\u4e0d\u8be6\u7ec6\u8bb2\u4e86\u3002\u53e6\u5916\u8fd8\u6709\u4e24\u4e2a\u5168\u5c40\u53d8\u91cf\uff0cSAVEQUERIES \u548c WP_DEBUG\uff0c\u7b2c\u4e00\u4e2a\u662f\uff0c\u53ef\u4ee5\u8ba9\u4f60\u628a\u8bbf\u95ee\u9875\u9762\u6267\u884c\u7684\u67e5\u8be2\u628a\u4fdd\u5b58\u5230 $this-&gt;queries \u8fd9\u4e2a\u6570\u7ec4\u4e2d\uff0c\u4ee5\u540e\u8c03\u8bd5\u7684\u65f6\u5019\u4f7f\u7528\u3002<\/p>\n<p><\/p>\n<p>\u6709\u4e86\u4ee5\u4e0a\u65b9\u6cd5\u5c31\u53ef\u4ee5\u5f88\u7b80\u5355\u7684\u5bf9MYSQL\u6570\u636e\u5e93\u8fdb\u884c\u64cd\u4f5c\u4e86\uff01\u4e0d\u7528\u518d\u8d39\u529b\u5199\u90a3\u4e48\u54e6\u6570\u636e\u5e93\u64cd\u4f5c\u8bed\u53e5\uff0c\u7701\u65f6\u7701\u529b\u662f\u6280\u672f\u733f\u5fc5\u5907\u7cbe\u54c1\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"\u3000\u3000\u4eca\u5929\u5728\u67e5\u770b\u6613\u4f01\uff23\uff2dS\u7684\u65f6\u5019\u5728\u91cc\u9762\u53d1\u73b0\u4e00\u4e2aEZSQL\u6570\u636e\u5e93\u64cd\u4f5c\u7c7b\uff01\u597d\u5947\u4e4b\u5fc3\u641c\u5bfb\u4e86\u4e0b\uff0c\u53d1\u73b0\u662f\u4e2a\u5f88\u4e0d\u9519\u7684\u6570\u636e\u5e93\u64cd \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"views":265,"_links":{"self":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/posts\/246"}],"collection":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/comments?post=246"}],"version-history":[{"count":0,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/posts\/246\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/media?parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/categories?post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/tags?post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}