{"id":7594,"date":"2024-11-14T10:56:51","date_gmt":"2024-11-14T02:56:51","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7594\/"},"modified":"2024-11-14T10:56:51","modified_gmt":"2024-11-14T02:56:51","slug":"phpmysql%ef%bc%9a%e5%a6%82%e4%bd%95%e4%bb%8e%e6%94%b6%e8%97%8f%e5%88%97%e8%a1%a8%e4%b8%ad%e8%af%bb%e5%8f%96%e6%96%87%e7%ab%a0%e6%88%96%e5%95%86%e5%93%81%e7%9a%84%e6%a0%87%e9%a2%98%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7594\/","title":{"rendered":"PHP+MySQL\uff1a\u5982\u4f55\u4ece\u6536\u85cf\u5217\u8868\u4e2d\u8bfb\u53d6\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173104564747148.jpg\" class=\"aligncenter\" title=\"PHP+MySQL\uff1a\u5982\u4f55\u4ece\u6536\u85cf\u5217\u8868\u4e2d\u8bfb\u53d6\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\uff1f\u63d2\u56fe\" alt=\"PHP+MySQL\uff1a\u5982\u4f55\u4ece\u6536\u85cf\u5217\u8868\u4e2d\u8bfb\u53d6\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>php+\uff1a\u8bfb\u53d6\u7528\u6237\u6536\u85cf\u5185\u5bb9<\/strong><\/p>\n<p>\u5728\u4e00\u4e2a\u7f51\u7ad9\u7684\u201c\u7528\u6237\u6536\u85cf\u201d\u529f\u80fd\u4e2d\uff0c\u9700\u8981\u4ece\u4e09\u4e2a\u6570\u636e\u8868\u4e2d\u8bfb\u53d6\u7528\u6237\u6536\u85cf\u7684\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\u3002\u4e09\u79cd\u6570\u636e\u8868\u5206\u522b\u4e3a\uff1a<\/p>\n<ul>\n<li> <strong>favorites<\/strong>\uff1a\u6536\u85cf\u6570\u636e\uff0c\u5305\u542b\u5b57\u6bb5 id\u3001type\uff081 \u4e3a\u5546\u54c1\uff0c2 \u4e3a\u6587\u7ae0\uff09\u3001cid\uff08\u6587\u7ae0\u6216\u5546\u54c1\u7684 id\uff09\u548c dateline\uff08\u6536\u85cf\u65e5\u671f\uff09<\/li>\n<li> <strong>goods<\/strong>\uff1a\u5546\u54c1\uff0c\u5305\u542b\u5b57\u6bb5 id \u548c title<\/li>\n<li> <strong>articles<\/strong>\uff1a\u6587\u7ae0\uff0c\u5305\u542b\u5b57\u6bb5 id \u548c title<\/li>\n<\/ul>\n<p><strong>\u9700\u6c42\uff1a<\/strong>\u6309\u7167 dateline \u964d\u5e8f\u8bfb\u53d6\u6536\u85cf\u6570\u636e\uff0c\u5e76\u901a\u8fc7 cid \u8bfb\u53d6\u5bf9\u5e94\u7684\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u6709\u4e24\u79cd\u5e38\u89c1\u7684\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p><strong>\u65b9\u6848 1\uff1a\u5faa\u73af\u8bfb\u53d6<\/strong><\/p>\n<pre>\/\/ \u8bfb\u53d6\u6536\u85cf\u6570\u636e\n$favorites = getFavoritesList();\n\n\/\/ \u5faa\u73af\u6bcf\u4e2a\u6536\u85cf\nforeach ($favorites as $favorite) {\n    \/\/ \u6839\u636e type \u5224\u65ad\u662f\u5546\u54c1\u8fd8\u662f\u6587\u7ae0\n    if ($favorite['type'] == 1) {\n        \/\/ \u4ece goods \u8868\u4e2d\u8bfb\u53d6\u5546\u54c1\u6807\u9898<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fPHP+MySQL\uff1a\u5982\u4f55\u4ece\u6536\u85cf\u5217\u8868\u4e2d\u8bfb\u53d6\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>php+\uff1a\u8bfb\u53d6\u7528\u6237\u6536\u85cf\u5185\u5bb9 \u5728\u4e00\u4e2a\u7f51\u7ad9\u7684\u201c\u7528\u6237\u6536\u85cf\u201d\u529f\u80fd\u4e2d\uff0c\u9700\u8981\u4ece\u4e09\u4e2a\u6570\u636e\u8868\u4e2d\u8bfb\u53d6\u7528\u6237\u6536\u85cf\u7684\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\u3002\u4e09\u79cd\u6570\u636e\u8868\u5206\u522b\u4e3a\uff1a favorites\uff1a\u6536\u85cf\u6570\u636e\uff0c\u5305\u542b\u5b57\u6bb5 id\u3001type\uff081 \u4e3a\u5546\u54c1\uff0c2 \u4e3a\u6587\u7ae0\uff09\u3001cid\uff08\u6587\u7ae0\u6216\u5546\u54c1\u7684 id\uff09\u548c dateline\uff08\u6536\u85cf\u65e5\u671f\uff09 goods\uff1a\u5546\u54c1\uff0c\u5305\u542b\u5b57\u6bb5 id \u548c title articles\uff1a\u6587\u7ae0\uff0c\u5305\u542b\u5b57\u6bb5 id \u548c title \u9700\u6c42\uff1a\u6309\u7167 dateline \u964d\u5e8f\u8bfb\u53d6\u6536\u85cf\u6570\u636e\uff0c\u5e76\u901a\u8fc7 cid \u8bfb\u53d6\u5bf9\u5e94\u7684\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u6709\u4e24\u79cd\u5e38\u89c1\u7684\u89e3\u51b3\u65b9\u6848\uff1a \u65b9\u6848 1\uff1a\u5faa\u73af\u8bfb\u53d6 \/\/ \u8bfb\u53d6\u6536\u85cf\u6570\u636e $favorites = getFavoritesList(); \/\/ \u5faa\u73af\u6bcf\u4e2a\u6536\u85cf foreach ($favorites as $favorite) { \/\/ \u6839\u636e type \u5224\u65ad\u662f\u5546\u54c1\u8fd8\u662f\u6587\u7ae0 if ($favorite[&#8216;type&#8217;] == 1) { \/\/ \u4ece goods \u8868\u4e2d\u8bfb\u53d6\u5546\u54c1\u6807\u9898 \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662fPHP+MySQL\uff1a\u5982\u4f55\u4ece\u6536\u85cf\u5217\u8868\u4e2d\u8bfb\u53d6\u6587\u7ae0\u6216\u5546\u54c1\u7684\u6807\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-7594","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=7594"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7594\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}