0
。我有一個問題,當我插入的時間來對數據庫有一個錯誤..對象無法轉換爲字符串
<?php
include ('includes/config.php');
$mysqli = new mysqli(DB_SERVER, DB_UNAME, DB_PASSWD, DB_NAME);
if (!$mysqli) {
throw new Exception($mysqli->connect_error, $mysqli->connect_errno);
}
$tqry = time();
$tqry = $mysqli->prepare("INSERT INTO table_time(table_time.time) VALUES (?) ");
if (!$tqry) {
throw new Exception($mysqli->error);
}
$tqry->bind_param('s', $tqry);
$tqry->execute();
?>
這有什麼錯誤?
在此先感謝..
的參數'bind_param'應該是要插入,不是'$ tqry'的時間。 – Barmar