{"id":1377,"date":"2014-11-05T16:36:44","date_gmt":"2014-11-05T08:36:44","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=1377"},"modified":"2014-11-05T17:55:21","modified_gmt":"2014-11-05T09:55:21","slug":"%e3%80%90vc%e3%80%91%e3%80%90mfc%e3%80%91%e9%93%be%e6%8e%a5%e6%93%8d%e4%bd%9cmysql%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/1377","title":{"rendered":"\u3010vc\u3011\u3010mfc\u3011\u94fe\u63a5\u64cd\u4f5cmysql\u6559\u7a0b"},"content":{"rendered":"

vc\u5982\u4f55\u94fe\u63a5mysql\u6570\u636e\u5e93<\/strong>\uff0c\u8fd9\u7bc7\u6587\u7ae0\u5c31\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u3002<\/p>\n

mysql\u7684\u5934\u6587\u4ef6\uff0clib\uff0cdll\u6587\u4ef6\uff0c\u6211\u662f\u7528\u7684wamp\u96c6\u6210\u5305\u7684\uff0cmsyql\u7248\u672c\u662f\u00a0mysql5.6.17 \u3002\u4e4b\u524d\u4e5f\u8bd5\u8fc7\u5176\u4ed6\u96c6\u6210\u5305\uff0c\u53d1\u73b0mysql\u7684\u4e00\u4e9b\u6587\u4ef6\u662f\u6ca1\u6709\u7684\uff08\u4e0d\u662f\u7cbe\u7b80\u6389\u4e86\uff09\uff0c\u6240\u4ee5\u5efa\u8bae\u4e0bwamp\u5427\u3002wamp sourceforge \u5b98\u7f51\uff1ahttp:\/\/sourceforge.net\/projects\/wampserver\/files\/WampServer%202\/WampServer%202.1\/<\/a><\/p>\n

\n
  • \u627e\u5230mysql\u6587\u4ef6\u5939\u4e0b\u7684\u3010include\u3011\u6587\u4ef6\u5939\uff0c\u653e\u5230\u6211\u4eec\u7684vc\u5de5\u7a0b\u76ee\u5f55\u4e0b<\/li>\n
  • \u8bbe\u7f6evc\u9879\u76ee\u5c5e\u6027\uff0c\u6dfb\u52a0\u5305\u542b\u3002\u5982\u4e0b\u56fe<\/li>\n<\/ul>\n

    \"\"<\/a><\/p>\n

    \n
  • \u00a0\u5728\u7528\u5230msyql\u7684\u6587\u4ef6\u4e2d\uff0c\u52a0\u4e0b\u4ee5\u4e0b\u4ee3\u7801<\/li>\n<\/ul>\n

    #include “mysql.h”<\/p>\n

    \n
  • \u58f0\u660e\u4e00\u4e2amysql\u53d8\u91cf<\/li>\n<\/ul>\n

    MYSQL mysql;<\/p>\n

    \n
  • \u65b0\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5f53\u7136\u8fd8\u6709\u5bf9\u5e94\u7684\u7528\u6237\u540d\u3002\u6211\u7684\u4e00\u5f8b\u662f “s”\u3002<\/li>\n
  • \u6211\u5728\u5bf9\u8bdd\u6846\u521d\u59cb\u5316\u51fd\u6570\u4e2d\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801<\/li>\n<\/ul>\n
    \t\/\/\u5f00\u59cb\u94fe\u63a5\u6570\u636e\u5e93\r\n\tmysql_init(&mysql);\r\n\tmysql_options(&mysql, MYSQL_SET_CHARSET_NAME, \"utf-8\"); \r\n\r\n\tif(!mysql_real_connect(&mysql,\"localhost\",\"user\",\"password\",\"user_db\",3306,NULL,0))\r\n\t{\r\n\t\tAfxMessageBox(\"\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t\/\/MessageBox(\"\u94fe\u63a5\u6570\u636e\u5e93\u6210\u529f\uff01\");\r\n\t}\r\n<\/pre>\n

    \u8349\uff0c\u4e0d\u5199\u4e86\uff0c\u96be\u4ea7\u4e86\u3002\u3002\u3002\u56e0\u4e3a\u73b0\u5728\u6211\u7528\u7684\u8fd9\u4e2awamp\u4e5f\u662f\u4e0d\u5b8c\u6574\u7684\uff0c\u6211\u7528\u4e86\u4e4b\u524d \u7684\u624d\u914d\u914d\u7f6e\u597d\u3002\u72d7\u65e5\u7684\u3002\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    vc\u5982\u4f55\u94fe\u63a5mysql\u6570\u636e\u5e93\uff0c\u8fd9\u7bc7\u6587\u7ae0\u5c31\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u3002 mysql\u7684\u5934\u6587\u4ef6\uff0clib\uff0cdll\u6587\u4ef6\uff0c\u6211\u662f\u7528\u7684wamp\u96c6\u6210\u5305\u7684\uff0cmsyql\u7248\u672c\u662f\u00a0mysql5.6.17 \u3002\u4e4b\u524d\u4e5f\u8bd5\u8fc7\u5176\u4ed6\u96c6\u6210\u5305\uff0c\u53d1\u73b0mysql\u7684\u4e00\u4e9b\u6587\u4ef6\u662f\u6ca1\u6709\u7684\uff08\u4e0d\u662f\u7cbe\u7b80\u6389\u4e86\uff09\uff0c\u6240\u4ee5\u5efa\u8bae\u4e0bwamp\u5427\u3002wamp sourceforge \u5b98\u7f51\uff1ahttp:\/\/sourceforge.net\/projects\/wampserver\/files\/WampServer%202\/WampServer%202.1\/ \u627e\u5230mysql\u6587\u4ef6\u5939\u4e0b\u7684\u3010include\u3011\u6587\u4ef6\u5939\uff0c\u653e\u5230\u6211\u4eec\u7684vc\u5de5\u7a0b\u76ee\u5f55\u4e0b \u8bbe\u7f6evc\u9879\u76ee\u5c5e\u6027\uff0c\u6dfb\u52a0\u5305\u542b\u3002\u5982\u4e0b\u56fe \u00a0\u5728\u7528\u5230msyql\u7684<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,219,9],"tags":[202,144,200],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1377"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=1377"}],"version-history":[{"count":6,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1377\/revisions"}],"predecessor-version":[{"id":1384,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1377\/revisions\/1384"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=1377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=1377"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=1377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}