我想將print_r輸出插入到數據庫中?插入print_r輸出到數據庫?
在數據庫中,結果爲1
?
如何解決這個問題?
<?php
processLog(print_r($dataArray));
function processLog($text) {
global $process, $db, $groupID;
print($text . "\n");
$SQL = "INSERT INTO enable_log (process_id, process_date, group_id, log_output, log_time)
VALUES(:process_id, :process_date, :group_id, :log_output, now())";
$q = $db->prepare($SQL);
$q->bindValue(":process_id", $process['pid']);
$q->bindValue(":process_date", $process['date']);
$q->bindValue(":group_id", $groupID);
$q->bindValue(":log_output", $text);
$q->execute();
}
?>
閱讀php.net文檔。 – Gedrox