爬库脚本
来源:互联网 发布:源码绑定域名绑定ip 编辑:程序博客网 时间:2024/05/17 05:08
<?phpset_time_limit(0);$fileName = 'testx.txt';$startTime = '1';$endTime = '2';$link = mysql_connect('ip:port', 'user', 'password');if (!$link) { die('Could not connect: ' . mysql_error());}mysql_select_db('dbname', $link) or die ('Can\'t use foo : ' . mysql_error());$res = mysql_query ( 'show tables;', $link);$return = array();$tables = array();while($row=mysql_fetch_array($res)) { $return[] = $row; }foreach( $return AS $key => $item ){ $table = $item[0]; if( strstr($table, 'table name') !== false ){ $tables[] = $table; }}$baobiao = array();$sql = 'select 1,2 from ';foreach( $tables AS $table ){ $temp = $sql.$table.' where 1=1 and tieba_video_url != \'\' '; $res = mysql_query ($temp, $link); $str = ''; while($row=mysql_fetch_array($res)) { if( $row['row_name'] > 0 ){ $post_id = $row['row_name']; $str.=$post_id."_".$row['row_b']."\r\n"; } } file_put_contents($fileName,$str,FILE_APPEND); usleep(1000);}mysql_close($link);echo "OK";
阅读全文
0 0
- 爬库脚本
- 无法找到脚本库
- 一个javascript脚本库
- 一个javascript脚本库
- Javascript脚本库
- Qte库编译脚本
- 全库导入脚本
- oracle导库脚本
- Git 建库脚本
- erlang 导入库脚本
- svn库迁移脚本
- oracle建库脚本
- 我的脚本库
- Oracle脱库脚本
- 脚本
- 脚本
- 脚本
- 脚本
- Python3中bytes和HexStr之间的转换
- 存储过程语法
- linux常用命令
- 兼容核
- 数据结构与算法学习:冒泡排序
- 爬库脚本
- MVC4+ef6 Dictionary实现按年月分组,使用Echart生成饼状图
- linux程序调试(一)------内存分布
- caffe*** Aborted at 1457505270 (unix time) try "date -d @1457505270" if you are using GNU date ***
- mysql常用命令/语句学习一
- SHU金马五校赛 L.零件组装 【状压DP】
- Android 和jsp登录接口
- 栈:矩阵的压缩存储
- 算法复习:二叉树的镜像