make GetTempTableName more robust

This commit is contained in:
yitam 2017-04-03 09:54:32 -07:00
parent 93c486b068
commit a917cfbf2c

View file

@ -21,9 +21,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 "#pdo_test_table" . $timestamp;
return "#php_test_table" . '_' . $timestamp . '_' . $random;
else
return $table . $timestamp;
}