Hello, I am looking to import a fairly large number of leads about 600k I am looking to do and executable php script and run that thru ssh. My question is I am trying to put together a statement that would import
first name, last name, email and home phone.
I am using the function below to generate the Auto ID but I am still struggling with how to append the email address correctly to the email table and how to structure the MYSQL to incrementally count the rows on the the database with the 600K records any input would be greatly appreciated really stuck
» Operating system type and version (CentOS)PHP Code:function create_guid()
{
$microTime = microtime();
list($a_dec, $a_sec) = explode(" ", $microTime);
$dec_hex = sprintf("%x", $a_dec* 1000000);
$sec_hex = sprintf("%x", $a_sec);
ensure_length($dec_hex, 5);
ensure_length($sec_hex, 6);
$guid = "";
$guid .= $dec_hex;
$guid .= create_guid_section(3);
$guid .= '-';
$guid .= create_guid_section(4);
$guid .= '-';
$guid .= create_guid_section(4);
$guid .= '-';
$guid .= create_guid_section(4);
$guid .= '-';
$guid .= $sec_hex;
$guid .= create_guid_section(6);
return $guid;
}
function create_guid_section($characters)
{
$return = "";
for($i=0; $i<$characters; $i++)
{
$return .= sprintf("%x", mt_rand(0,15));
}
return $return;
}
function ensure_length(&$string, $length)
{
$strlen = strlen($string);
if($strlen < $length)
{
$string = str_pad($string,$length,"0");
}
else if($strlen > $length)
{
$string = substr($string, 0, $length);
}
}
function microtime_diff($a, $b)
{
list($a_dec, $a_sec) = explode(" ", $a);
list($b_dec, $b_sec) = explode(" ", $b);
return $b_sec - $a_sec + $b_dec - $a_dec;
}
» Sugar version and edition 5.2.0 (Build 5380)
» Webserver type and version Apache/2.2.3
» PHP version (i.e. 5.1.6)


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks