open($query,$Conn,1,1);/">
时间:2021-07-01 10:21:17 帮助过:25人阅读
open($MM_Conn_STRING);//链接打开数据源 $query="select * from dm order by id asc"; $RS->open($query,$Conn,1,1);//执行语句,返回数据集 echo"共有:".$RS->RecordCount."条记录结果!
";//纪录数 for ($i=0;$i<$RS->fields->Count;$i++) echo $RS->fields[$i]->Name." ";//遍历字段名 echo "
"; $connect = mysql_connect("192.168.0.51", "username", "password"); while(!$RS->EOF) { $query = "insert into smsGames.nanjing_toponym values('"; $query .= $RS->fields["id"]->value."', '"; $query .= $RS->fields["name"]->value."', '"; $query .= $RS->fields["symbol"]->value."', '"; $query .= str_replace("\r\n", "", $RS->fields["weizhi"]->value)."', '"; $query .= $RS->fields["way"]->value."', '"; $query .= $RS->fields["class"]->value."', '"; $query .= str_replace("\r\n", "", $RS->fields["history"]->value)."', '"; $query .= str_replace("\r\n", "", $RS->fields["addr"]->value)."')"; $result = mysql_query($query, $connect); if (!$result) print "Error:".mysql_error()."
Query:".$query."
"; else print $RS->fields["id"]->value." "; $RS->MoveNext(); $i++; } //释放资源 $Conn->Close(); $RS=NULL; $Conn =NULL; ?>