Using Mysqli bind_param with date and time columns?

前端 未结 8 912
清歌不尽
清歌不尽 2020-12-08 06:14

How do you insert data into a MySQL date or time column using PHP mysqli and bind_param?

8条回答
  •  一整个雨季
    2020-12-08 06:41

    $q = "insert into order_details (order_id, product_id, product_name, product_quantity, product_price, created_at, updated_at) values (?, ?, ?, ?, ?, NOW(), NOW())";

                $stmt = mysqli_prepare($dbc, $q);
    

    mysqli_stmt_bind_param($stmt, 'iisid',$ord, $pid, $_SESSION['product_name'], $qty, $price);

提交回复
热议问题