{"id":766,"date":"2012-09-05T13:38:48","date_gmt":"2012-09-05T05:38:48","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=766"},"modified":"2013-08-24T00:30:45","modified_gmt":"2013-08-23T16:30:45","slug":"mqsql%e6%95%b0%e6%8d%ae%e5%85%a5%e5%ba%93%e6%97%b6%e9%87%8d%e5%a4%8d%e6%a3%80%e6%b5%8b%e5%87%bd%e6%95%b0-php","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/766","title":{"rendered":"mysql\u6570\u636e\u5165\u5e93\u65f6\u91cd\u590d\u68c0\u6d4b\u51fd\u6570-php"},"content":{"rendered":"

mysql\u6570\u636e\u5165\u5e93\u65f6\u91cd\u590d\u68c0\u6d4b\u51fd\u6570-php.\u8fd9\u4e2a\u51fd\u6570\u7684\u529f\u80fd\u5c31\u662f\u5224\u65ad\u8981\u52a0\u5165\u7684\u6570\u636e\uff0c\u6570\u636e\u5e93\u7684\u4e00\u4e2a\u8868\u7684\u5176\u4e2d\u7684\u6307\u5b9a\u5b57\u6bb5\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u76f8\u540c\u6570\u636e\u4e86\u3002\u5b58\u5728\u51fd\u6570\u8fd4\u56de1\uff0c\u53cd\u52190.<\/p>\n

#\u5165\u5e93\u65f6\u662f\u5426\u91cd\u590d\u68c0\u6d4b\u51fd\u6570\uff0c\u82e5\u5b58\u5728\u8fd4\u56de1,\u4e0d\u5b58\u5728\u5c31\u8fd4\u56de0.\u4f7f\u7528\u65f6\u8981\u6ce8\u610f\u53d6\u53cd<\/p>\n

function exist_check($data,$table,$field){<\/p>\n

$result=mysql_query(“select * from $table”);<\/p>\n

$sql=mysql_fetch_array($result);<\/p>\n

$result_check=0;#\u5148\u5047\u8bbe\u662f\u6ca1\u6709\u91cd\u590d\u7684<\/p>\n

do\u00a0{<\/p>\n

if($data==$sql[$field]){<\/p>\n

$result_check=true;<\/p>\n

break;<\/p>\n

}<\/p>\n

}while($sql=mysql_fetch_array($result));<\/p>\n

return($result_check);<\/p>\n

}<\/p>\n

#\u91cd\u590d\u68c0\u6d4b\u51fd\u6570\u5b8c\u6bd5<\/p><\/blockquote>\n

————————————————————–
\n#\u5165\u5e93\u65f6\u662f\u5426\u91cd\u590d\u68c0\u6d4b\u51fd\u6570\uff0c\u82e5\u5b58\u5728\u8fd4\u56de1,\u4e0d\u5b58\u5728\u5c31\u8fd4\u56de0.\u4f7f\u7528\u65f6\u8981\u6ce8\u610f\u53d6\u53cd<\/p>\n

function exist_check($data,$table,$field){<\/p>\n

$result=mysql_query(\"select * from $table\");<\/p>\n

$sql=mysql_fetch_array($result);<\/p>\n

$result_check=0;#\u5148\u5047\u8bbe\u662f\u6ca1\u6709\u91cd\u590d\u7684<\/p>\n

do {<\/p>\n

if($data==$sql[$field]){<\/p>\n

$result_check=true;<\/p>\n

break;<\/p>\n

}<\/p>\n

}while($sql=mysql_fetch_array($result));<\/p>\n

return($result_check);<\/p>\n

}<\/p>\n

#\u91cd\u590d\u68c0\u6d4b\u51fd\u6570\u5b8c\u6bd5
\n<\/code><\/p>\n

http:\/\/www.youthtribe.com\/archives\/766 \u8f6c\u8f7d\u8bf7\u4fdd\u7559\u94fe\u63a5\uff0c\u8c22\u8c22<\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

mysql\u6570\u636e\u5165\u5e93\u65f6\u91cd\u590d\u68c0\u6d4b\u51fd\u6570-php.\u8fd9\u4e2a\u51fd\u6570\u7684\u529f\u80fd\u5c31\u662f\u5224\u65ad\u8981\u52a0\u5165\u7684\u6570\u636e\uff0c\u6570\u636e\u5e93\u7684\u4e00\u4e2a\u8868\u7684\u5176\u4e2d\u7684\u6307\u5b9a\u5b57\u6bb5\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u76f8\u540c\u6570\u636e\u4e86\u3002\u5b58\u5728\u51fd\u6570\u8fd4\u56de1\uff0c\u53cd\u52190. #\u5165\u5e93\u65f6\u662f\u5426\u91cd\u590d\u68c0\u6d4b\u51fd\u6570\uff0c\u82e5\u5b58\u5728\u8fd4\u56de1,\u4e0d\u5b58\u5728\u5c31\u8fd4\u56de0.\u4f7f\u7528\u65f6\u8981\u6ce8\u610f\u53d6\u53cd function exist_check($data,$table,$field){ $result=mysql_query(“select * from $table”); $sql=mysql_fetch_array($result); $result_check=0;#\u5148\u5047\u8bbe\u662f\u6ca1\u6709\u91cd\u590d\u7684 do\u00a0{ if($data==$sql[$fie<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/766"}],"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=766"}],"version-history":[{"count":4,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/766\/revisions"}],"predecessor-version":[{"id":768,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/766\/revisions\/768"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=766"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}