{"id":253,"date":"2023-02-24T06:10:26","date_gmt":"2023-02-23T22:10:26","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=253"},"modified":"2023-04-30T15:18:56","modified_gmt":"2023-04-30T07:18:56","slug":"mysql-determine-whether-database-tables-and-table-fields-exist","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/24\/mysql-determine-whether-database-tables-and-table-fields-exist\/","title":{"rendered":"MySQL\u5224\u65ad\u6570\u636e\u5e93\u8868\u548c\u8868\u5b57\u6bb5\u662f\u5426\u5b58\u5728"},"content":{"rendered":"<h3>\u5224\u65ad\u6570\u636e\u5e93\u8868\u662f\u5426\u5b58\u5728\uff0c<\/h3>\n<pre><code class=\"language-sql\">\/\/ mysql\nSELECT table_name FROM information_schema.tables WHERE table_name=#{tableName, jdbcType=VARCHAR}<\/code><\/pre>\n<p><!-- more --><\/p>\n<h3>\u5224\u65ad\u6570\u636e\u8868\u5b57\u6bb5\u662f\u5426\u5b58\u5728<\/h3>\n<pre><code class=\"language-sql\">\/\/ mysql\nSELECT column_name FROM information_schema.columns WHERE table_name=#{tableName, jdbcType=VARCHAR} AND column_name=#{columnName, jdbcType=VARCHAR}<\/code><\/pre>\n<p>\u5982\u679c\u5b58\u5728\u5219\u6709\u663e\u793a\u5185\u5bb9\uff0c\u5426\u5219\u4e3a\u7a7a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5224\u65ad\u6570\u636e\u5e93\u8868\u662f\u5426\u5b58\u5728\uff0c \/\/ mysql SELECT table_name FROM information [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=253"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/253\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}