大bug:插入后立即查出最大的id,应该用mysql_insert_id();取代,否则花费巨大时间成本.
global $dbnameApplication;
$this->log_error_dl(
" request_download Token Created=0 " );
//try
to insert a record to File_Download_Queue
$Time_Stamp =
time();
$sql="INSERT
INTO `File_Download_Queue`
(`File_Download_Queue_ID`,
`File_ID`, `User_ID`,
`User_IP_Address`,
`Server_ID`, `File_Download_Token`,
`File_Download_Flag`,
`Download_Expiration_Period`, `Timestamp_Request`,
`Timestamp_Last_Poll`,
`Timestamp_End`, `Log_Type`,
`Data_Size`)
VALUES
(NULL,
'$this->Check_File_ID', '$this->Check_User_ID',
'$this->Check_User_IP_Address', '$this->Check_Server_ID',
'$this->Check_Token_To_Decrypt',
'".$this->f_d_flag["0"]."', '0', '$Time_Stamp', '$Time_Stamp',
'$Time_Stamp', '0', '0')";
$this->log_error_dl($sql);
App_dbConnect_Master_Write($dbnameApplication);
$result =
mysql_query($sql);
if(!$result)
$this->log_error_dl( mysql_error());
$this->File_Download_Queue_ID=
mysql_insert_id();
$this->log_error_dl(
" File_Download_Queue_ID=".$this->File_Download_Queue_ID
);