开发者

php load 10000 records

I need to write a php script to load 1 million record and make insert statements of them.

i make each select开发者_如何学C to return only 100,000 record ,but the script just do nothing

ini_set('memory_limit', '200M');
ini_set('max_execution_time', '0');

include_once("/var/www/adodb/adodb.inc.php");

$DB_Conn = NewADOConnection("mssql");

$DB_Conn->PConnect("*.*.*.*", "***","***", "**");

echo 'Start'."\n";

$rs = $DB_Conn->_Execute("SELECT  * FROM ***  where id >=1 and id <=100000 order by id asc ");

while (!$rs->EOF) {
//print the result to a file as insert statements,and i try print to the console 
    $rs->MoveNext();
}

but the script just print start ,i wait it very long but nothing printed.

i try to set ini_set('memory_limit', '200M');

but it has no effect, i appreciate your help.

Added

Can i export records from mssql 2000 to mysql in any other way.(under linux without gui)


Morning,

i wouldnt fetch so many records in one step, why not 50.000 per run or something like this? Further you can try to set the timelimit to 0 ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜