logget.inc
815 Bytes
<?PHP
// 送信Logを保存する
//
// 戻り値 成功=True 失敗=False
function func_LogInput($user_id,$logFrom,$logTo,$logType,$logDate,$intCountLog){
$res = "True";
$hostname="172.31.16.254";
$database="post_kanri";
if( !$pg_con2=pg_connect("host=$hostname port=5434 dbname=$database user=pgsqladmin password=pgsqladmin") ) {
print "Error : connect to ${hostname}<br>";
exit;
}
for($i=0;$i<$intCountLog;$i++){
if($logTo[$i]!=""){
$strSQL = "Insert into send_history_tbl ".
"(user_id,from_mail,to_mail,send_time,send_type) VALUES ".
"('".$user_id."',".
"'".$logFrom[$i]."',".
"'".$logTo[$i]."',".
"'".$logDate[$i]."',".
$logType[$i]."".
")";
$objRecSet = pg_exec($pg_con2,$strSQL);
if($objRecSet==false){
$res = "False";
}
}
}
return $res;
}
?>