make GetTempTableName more robust

This commit is contained in:
yitam 2017-04-03 09:18:53 -07:00
parent e4f37f3b5d
commit 93c486b068

View file

@ -47,9 +47,10 @@ function GetTempTableName($table = '')
{
// A temporary table name with the '#' prefix will be automatically
// dropped once the connection is closed
$random = mt_rand(1,1000);
$timestamp = round(microtime(true)*1000);
if (strlen($table) == 0)
return "#php_test_table" . $timestamp;
return "#php_test_table" . '_' . $timestamp . '_' . $random;
else
return $table . $timestamp;
}