{"id":180890,"date":"2024-11-09T14:02:15","date_gmt":"2024-11-09T06:02:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/180890\/"},"modified":"2024-11-09T14:02:15","modified_gmt":"2024-11-09T06:02:15","slug":"%e6%b7%b1%e5%85%a5%e4%ba%86%e8%a7%a3%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9a%e6%8e%a2%e7%a9%b6type%e5%b1%ac%e6%80%a7%e7%9a%84%e4%bd%9c%e7%94%a8%e5%8f%8a%e6%84%8f%e7%be%a9-%e6%95%b8%e6%93%9a%e5%ba%abtype","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/180890\/","title":{"rendered":"\u6df1\u5165\u4e86\u89e3\u6578\u64da\u5eab\uff1a\u63a2\u7a76type\u5c6c\u6027\u7684\u4f5c\u7528\u53ca\u610f\u7fa9 (\u6578\u64da\u5eabtype\u662f\u4ec0\u9ebc)"},"content":{"rendered":"<h1 id=\"%e6%b7%b1%e5%85%a5%e4%ba%86%e8%a7%a3%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9a%e6%8e%a2%e7%a9%b6type%e5%b1%ac%e6%80%a7%e7%9a%84%e4%bd%9c%e7%94%a8%e5%8f%8a%e6%84%8f%e7%be%a9-ORZcxmsnMk\">\u6df1\u5165\u4e86\u89e3\u6578\u64da\u5eab\uff1a\u63a2\u7a76type\u5c6c\u6027\u7684\u4f5c\u7528\u53ca\u610f\u7fa9<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u8a2d\u8a08\u548c\u7ba1\u7406\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002\u6578\u64da\u5eab\u7684\u7d50\u69cb\u548c\u985e\u578b\u76f4\u63a5\u5f71\u97ff\u5230\u6578\u64da\u7684\u5b58\u5132\u3001\u6aa2\u7d22\u548c\u8655\u7406\u6548\u7387\u3002\u5176\u4e2d\uff0ctype\u5c6c\u6027\u5728\u6578\u64da\u5eab\u4e2d\u626e\u6f14\u8457\u95dc\u9375\u89d2\u8272\uff0c\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0etype\u5c6c\u6027\u7684\u4f5c\u7528\u53ca\u5176\u610f\u7fa9\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%aftype%e5%b1%ac%e6%80%a7%ef%bc%9f-ORZcxmsnMk\">\u4ec0\u9ebc\u662ftype\u5c6c\u6027\uff1f<\/h2>\n<p>\u5728\u6578\u64da\u5eab\u4e2d\uff0ctype\u5c6c\u6027\u901a\u5e38\u6307\u7684\u662f\u6578\u64da\u985e\u578b\uff08Data Type\uff09\uff0c\u5b83\u5b9a\u7fa9\u4e86\u6578\u64da\u7684\u6027\u8cea\u548c\u7bc4\u570d\u3002\u6bcf\u4e00\u500b\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff08DBMS\uff09\u90fd\u6703\u63d0\u4f9b\u4e00\u7d44\u9810\u5b9a\u7fa9\u7684\u6578\u64da\u985e\u578b\uff0c\u9019\u4e9b\u985e\u578b\u53ef\u4ee5\u7528\u4f86\u63cf\u8ff0\u8868\u4e2d\u7684\u5217\u3002\u5e38\u898b\u7684\u6578\u64da\u985e\u578b\u5305\u62ec\u6574\u6578\uff08Integer\uff09\u3001\u6d6e\u9ede\u6578\uff08Float\uff09\u3001\u5b57\u7b26\uff08Character\uff09\u3001\u65e5\u671f\uff08Date\uff09\u7b49\u3002<\/p>\n<h2 id=\"type%e5%b1%ac%e6%80%a7%e7%9a%84%e4%bd%9c%e7%94%a8-ORZcxmsnMk\">type\u5c6c\u6027\u7684\u4f5c\u7528<\/h2>\n<ul>\n<li><strong>\u6578\u64da\u5b8c\u6574\u6027\uff1a<\/strong>type\u5c6c\u6027\u6709\u52a9\u65bc\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u3002\u901a\u904e\u9650\u5236\u5217\u7684\u6578\u64da\u985e\u578b\uff0c\u6578\u64da\u5eab\u53ef\u4ee5\u9632\u6b62\u4e0d\u6b63\u78ba\u7684\u6578\u64da\u88ab\u63d2\u5165\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4e00\u500b\u5217\u88ab\u5b9a\u7fa9\u70ba\u6574\u6578\u985e\u578b\uff0c\u90a3\u9ebc\u4efb\u4f55\u975e\u6574\u6578\u7684\u6578\u64da\u90fd\u5c07\u88ab\u62d2\u7d55\u3002<\/li>\n<li><strong>\u5b58\u5132\u6548\u7387\uff1a<\/strong>\u4e0d\u540c\u7684\u6578\u64da\u985e\u578b\u4f54\u7528\u4e0d\u540c\u7684\u5b58\u5132\u7a7a\u9593\u3002\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u985e\u578b\u53ef\u4ee5\u6709\u6548\u5730\u7bc0\u7701\u5b58\u5132\u7a7a\u9593\u3002\u4f8b\u5982\uff0c\u4f7f\u7528TINYINT\u4f86\u5b58\u5132\u5c0f\u7bc4\u570d\u7684\u6574\u6578\uff0c\u800c\u4e0d\u662f\u4f7f\u7528INT\uff0c\u9019\u6a23\u53ef\u4ee5\u6e1b\u5c11\u6578\u64da\u5eab\u7684\u6574\u9ad4\u5927\u5c0f\u3002<\/li>\n<li><strong>\u6027\u80fd\u512a\u5316\uff1a<\/strong>\u6578\u64da\u985e\u578b\u7684\u9078\u64c7\u4e5f\u6703\u5f71\u97ff\u67e5\u8a62\u6027\u80fd\u3002\u67d0\u4e9b\u6578\u64da\u985e\u578b\u5728\u67e5\u8a62\u6642\u6bd4\u5176\u4ed6\u985e\u578b\u66f4\u5feb\u3002\u4f8b\u5982\uff0c\u5c0d\u65bc\u6578\u5b57\u985e\u578b\u7684\u6578\u64da\uff0c\u6578\u64da\u5eab\u53ef\u4ee5\u66f4\u5feb\u5730\u9032\u884c\u8a08\u7b97\u548c\u6392\u5e8f\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e7%9a%84%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b-ORZcxmsnMk\">\u5e38\u898b\u7684\u6578\u64da\u985e\u578b<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u6578\u64da\u985e\u578b\u53ca\u5176\u7528\u9014\uff1a<\/p>\n<ul>\n<li><strong>\u6574\u6578\uff08Integer\uff09\uff1a<\/strong>\u7528\u65bc\u5b58\u5132\u6574\u6578\u503c\uff0c\u901a\u5e38\u7528\u65bc\u8a08\u6578\u6216\u7d22\u5f15\u3002<\/li>\n<li><strong>\u6d6e\u9ede\u6578\uff08Float\uff09\uff1a<\/strong>\u7528\u65bc\u5b58\u5132\u5e36\u5c0f\u6578\u7684\u6578\u5b57\uff0c\u9069\u5408\u9700\u8981\u7cbe\u78ba\u8a08\u7b97\u7684\u60c5\u6cc1\u3002<\/li>\n<li><strong>\u5b57\u7b26\uff08Character\uff09\uff1a<\/strong>\u7528\u65bc\u5b58\u5132\u6587\u672c\u6578\u64da\uff0c\u5982\u59d3\u540d\u3001\u5730\u5740\u7b49\u3002<\/li>\n<li><strong>\u65e5\u671f\uff08Date\uff09\uff1a<\/strong>\u7528\u65bc\u5b58\u5132\u65e5\u671f\u548c\u6642\u9593\u4fe1\u606f\uff0c\u9069\u5408\u9700\u8981\u6642\u9593\u6233\u7684\u61c9\u7528\u3002<\/li>\n<\/ul>\n<h2 id=\"type%e5%b1%ac%e6%80%a7%e7%9a%84%e6%84%8f%e7%be%a9-ORZcxmsnMk\">type\u5c6c\u6027\u7684\u610f\u7fa9<\/h2>\n<p>type\u5c6c\u6027\u4e0d\u50c5\u50c5\u662f\u6578\u64da\u5eab\u8a2d\u8a08\u4e2d\u7684\u4e00\u500b\u6280\u8853\u7d30\u7bc0\uff0c\u5b83\u9084\u5c0d\u6574\u500b\u61c9\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u7dad\u8b77\u6027\u6709\u8457\u6df1\u9060\u7684\u5f71\u97ff\u3002\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u985e\u578b\u53ef\u4ee5\u63d0\u9ad8\u6578\u64da\u5eab\u7684\u6027\u80fd\uff0c\u6e1b\u5c11\u932f\u8aa4\uff0c\u4e26\u63d0\u9ad8\u958b\u767c\u6548\u7387\u3002\u6b64\u5916\uff0c\u826f\u597d\u7684\u6578\u64da\u985e\u578b\u8a2d\u8a08\u9084\u80fd\u5920\u4f7f\u6578\u64da\u5eab\u7d50\u69cb\u66f4\u52a0\u6e05\u6670\uff0c\u4fbf\u65bc\u672a\u4f86\u7684\u64f4\u5c55\u548c\u7dad\u8b77\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-ORZcxmsnMk\">\u7d50\u8ad6<\/h2>\n<p>\u5728\u6578\u64da\u5eab\u8a2d\u8a08\u4e2d\uff0ctype\u5c6c\u6027\u662f\u4e0d\u53ef\u5ffd\u8996\u7684\u91cd\u8981\u56e0\u7d20\u3002\u5b83\u4e0d\u50c5\u5f71\u97ff\u6578\u64da\u7684\u5b58\u5132\u548c\u6aa2\u7d22\u6548\u7387\uff0c\u9084\u95dc\u4fc2\u5230\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u61c9\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u3002\u56e0\u6b64\uff0c\u5728\u8a2d\u8a08\u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u61c9\u8a72\u4ed4\u7d30\u8003\u616e\u6bcf\u4e00\u500b\u5217\u7684\u6578\u64da\u985e\u578b\u9078\u64c7\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u5eab\u7684\u9ad8\u6548\u904b\u884c\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc\u6578\u64da\u5eab\u7684\u8a2d\u8a08\u548c\u7ba1\u7406\u6709\u9032\u4e00\u6b65\u7684\u9700\u6c42\uff0c\u6216\u8005\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u95dc\u65bc<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u548c<a href=\"https:\/\/server.hk\">\u4e91\u670d\u52a1\u5668<\/a>\u7684\u8cc7\u8a0a\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6df1\u5165\u4e86\u89e3\u6578\u64da\u5eab\u4e2dtype\u5c6c\u6027\u7684\u4f5c\u7528\u53ca\u610f\u7fa9\uff0c\u63a2\u7d22\u5176\u5728\u6578\u64da\u7ba1\u7406\u548c\u7d50\u69cb\u5316\u4e2d\u7684\u91cd\u8981\u6027\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-180890","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/180890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=180890"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/180890\/revisions"}],"predecessor-version":[{"id":180891,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/180890\/revisions\/180891"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=180890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=180890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=180890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}