When using prepared statements in MySQLi, and inserting a date into a MySQL database, what parameter should i then use?
Example code:
<?php
$db = new mysqli('localhost', 'root', '', 'database');
$date = date("Y-m-d")
$stmt = $db->prepare("INSERT INTO table (date) VALUE (?)");
$stmt->bind_param("WHAT PARAMETER TO USE?", $date); // <--- What parameter?
$stnt->execute();
$stmt->close();
?>
Summary:
When inserting into MySQL database with MySQLI (Row type is 'date'), what parameter is the correct to use with the bind_param
when using prepared statements? Is it just 's' for string, or...?
If i made some bad code above, i would be happy to know. I'm new to MySQLi, and it would be nice to know what i made wrong.
Thanks in advance.