I have clients submitting urls in a form as much as 50k entries and I want to import them in bulk using the least resources.
Importing them one by one takes so much time and almost eats the CPU in full.
Then I tried this
foreach ($urls as $url){
$now = time();
if (($url=="") || (!strstr($url, 'http://')))
continue;
// insert into characters (name, show) values ('peter griffin','family guy'),('homer simpson','simpsons');
$statement.='(\'' . $userid . '\',\'' . $camp_id . '\',\'' . $now . '\',\'' . $url . '\'),';
}
$statement=substr($statement, 0, strlen($statement)-1);
$sql2="insert into links (userid, campaign_id, submit_date, link) values '$statement'";
mysql_query($sql2);
Still not the best. Any other suggestions?