how build infinite mysql insert query php but wasting memory


i have formula looking something this:



$data = file_get_contents($tempfile); // maybe 30mb record data, php's memory
$hash = md5($data);
$query = "insert some_table
set blobdata = '" . mysql_real_escape_string($data) . "',
blobhash = '$hash'
";
mysql_query($query);


i know isn't unequivocally fit any '.' operators reallocate bigger memory retard 30mb twine copied several times.



is there anything some-more fit following solution?



$data = file_get_contents($tempfile); // maybe 30mb record data, php's memory
$hash = md5($data);
$query = "insert some_table set blobdata = '%s', blobhash = '$hash'";
mysql_query(sprintf($query, mysql_real_escape_string($data)));


Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members