"; exit(); } if (@mysql_select_db($DB_Name,$conn)==FALSE) { echo "打开数据库:".$DB_Name." 失败!"; exit(); } mysql_query("set names 'utf8'"); $num = 1; $out_put_str = ''; if (ob_get_level() == 0) ob_start(); for ($i=0;$i<$beishu;$i++){ $new_start_num = $i*$max_limit_num+$gavin_start_num; if ($i == ($beishu-1)) $max_limit_num += $yushu; $sql = "select username,password from `table_name` limit ".$new_start_num.",".$max_limit_num; //配置SQL语句 $res = mysql_query($sql) or die(mysql_error()); while($result = mysql_fetch_array($res)) { $num ++; $out_put_str = $result["username"]."-->".$result["password"]."\n"; //格式化脱出的数据,根据SQL中的字段调整 if ($num >= $max_cache_num){ @ob_end_flush(); $num = 0; } echo $out_put_str; // unset($out_put_str); } } ?>