tags:

views:

80

answers:

1

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

i make each select 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)

+1  A: 

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 ?

ArneRie
Sorry i forget to mention that the biggest number work for me is 1000do you mean by time limit max_execution_time
Mario
yes set_time_limit(0);
ArneRie