I have the following code:
function dbInsert()
{
global $dbcon, $dbtable;
global $inputData;
$sqlQuery = 'INSERT INTO ' . $dbtable . ' (id_author, date, title, description) VALUES (?, ?, ?, ?)';
$stmt = $dbcon->prepare($sqlQuery);
echo $sqlQuery;
$stmt->bind_param('isss', $inputData['idAuthor'], $inputData['date'], $inputData['title'], $inputData['description']);
$stmt->execute();
$stmt->close();
header('Location: ./news.php?order=' . $_GET['order'] . '&sort=' . $_GET['sort'] . '&filter=' . $_GET['filter'] . '&page=' . $_GET['page'] . '');
}
$inputData['date'] is formatted as dd.mm.yyyy ex (18.02.2010)
I couldnt find a date parameter so I am trying to insert it as a string, is this right? I assume I need to tell mysql how to handle the input but could not find anything on the subject. The equivalent in ORACLE would be TO_DATE(?, 'dd.mm.yyyy') if it helps clarify what i am asking.