我試圖插入一些值到我的數據庫,但我沒有結果,但代碼沒有錯誤,並且結果標籤表示它成功。我的數據庫連接工作。如何檢查這裏的問題,我困惑。INSERT no Result Value
我的代碼這裏
// insert new data to menu table
$sql_query = "INSERT INTO tbl_jadwal (Nama_Lokasi, Category_ID, Longitude, Latitude, Phone, Email, Menu_image, Description)
VALUES(?, ?, ?, ?, ?, ?, ?, ?)";
$upload_image = 'upload/images/' . $menu_image;
$stmt = $connect->stmt_init();
if ($stmt->prepare($sql_query))
{
// Bind your variables to replace the ?s
$stmt->bind_param('sssssss',
$nama_lokasi,
$category_ID,
$longitude,
$latitude,
$phone,
$email,
$upload_image,
$description
);
// Execute query
$stmt->execute();
// store result
$result = $stmt->store_result();
$stmt->close();
}
add'error_reporting(E_ALL); ini_set('display_errors',1);'緊跟在頁面上的<?php'並檢查錯誤 –
不知道$ stmt - > bind_param()'工作時,數字不同,但你有7 x''',你傳遞8個變量那裏 –