璇诲彇ACCESS鏁版嵁鍒癕YSQL鐨凱HP浠g爜 - PHP鍏ラ棬
程序员文章站
2022-06-11 12:30:39
...
涓嬮潰瀹炰緥姣旇緝绠€鍗?灏辨槸鍏堝埄鐢╟om鎺ュ彛璇诲彇access鏁版嵁搴?鎶婃暟鎹鍙栧悗鍐嶈繛鎺ysql鏁欑▼鏁版嵁搴?鎶婂搴旂殑瀛楁insert鍒癿ysql瀵瑰簲鐨勮〃涓庡瓧娈靛氨瀹炵幇浜?璇诲彇ACCESS鏁版嵁鍒癕YSQL鐨凱HP浠g爜濡備笅:
Open($connstr); $rs = new COM("ADODB.RecordSet"); //寮€婧愪唬鐮乸hprm.com $rs->Open("select * from News where bigclassname='瑁呬慨璇惧爞'",$conn,1,3); while(!$rs->eof){ switch ($rs->Fields[4]){ case "瑁呬慨椤鹃棶": $sclass=1; break; case "鍘ㄥ崼绌洪棿": $sclass=2; break; case "瀹跺叿鐗╄": $sclass=3; break; case "鐢靛櫒宸ョ▼": $sclass=4; break; case "灞呴グ椋庢櫙": $sclass=5; break; case "鏉愭枡骞胯": $sclass=6; break; default: $sclass=1; } if ($rs->Fields[6]){ $spic=""; }else{ $spic=$rs->Fields[6]; } if ($rs->Fields[7]){ $user=""; }else{ $user=$rs->Fields[7]; } if ($rs->Fields[9]){ $hits=1; }else{ $hits=$rs->Fields[9]; } $sql="insert into rc_news(n_title,n_content,n_bclass,n_sclass,n_pic,n_spic,n_user,n_hits,n_audit) values('".$rs->Fields[1]."','".$rs->Fields[2]."',1,".$sclass.",'','".$spic."','".$user."',".$hits.",1)"; $result=mysql _query($sql); //echo $rs->Fields[1]; //echo "
"; $rs->Movenext(); //灏嗚褰曢泦鎸囬拡涓嬬Щ } $rs->close();
鏈枃鍦板潃锛?a target="_self" data-cid="10425" href="">
杞浇闅忔剰锛屼絾璇烽檮涓婃枃绔犲湴鍧€:-)
上一篇: apache设置有关问题