mysql获取600000条数据
时间:2021-07-01 10:21:17
帮助过:11人阅读
set_time_limit(0
);
header("Content-Type: text/html; charset=utf-8"
);
$newcon =
mysql_connect(‘host‘, ‘user‘, ‘pwd‘
);
$html = ‘<html><head></head><body><div style="margin-top:10px;" id="dataarea"><table border="1"><tbody><tr><th>列名</th></tr><tr>‘
;
echo $html;
static $i = 600000
;
static $j = 0
;
if (
$newcon) {
if (
mysql_select_db("db",
$newcon)) {
for(
$i;
$i<600000;
$i++
){
$sql = "select x,y,z from userinfo_10022 where UserID =
$i"
;
$result =
mysql_query(
$sql,
$newcon);
if (
$result) {
while (
$trow =
mysql_fetch_array(
$result)) {
if(
$j%5 == 0
){
echo ‘</tr><tr>‘
;
}
$j++
;
if(
$j> 20){
die (‘ok‘
);}
echo ‘<td>‘.
$trow[‘x‘].‘</td>‘
;
}
}
}
}
mysql_close(
$newcon);
}
echo ‘</tr></tbody></div></body><html>‘
;
?>
mysql获取600000条数据
标签:color 获取 ade pre nec class new text order