1
I need to pass a date to the database. I will use the PDO class, but I have the following question. When creating "bindValue()" what kind of constant should I declare in PDO::PARAM_ ?
1
I need to pass a date to the database. I will use the PDO class, but I have the following question. When creating "bindValue()" what kind of constant should I declare in PDO::PARAM_ ?
2
For dates, always the default, which is PDO::PARAM_STR
. Anyway, when you write a normal query, the date is sent as string
.
https://stackoverflow.com/questions/2374631/pdoparam-for-dates
Browser other questions tagged php mysql pdo
You are not signed in. Login or sign up in order to post.
PDO::PARAM_STR
that one– novic
String constant ?
– ayelsew
is yes to save dates in format
yyyy-mm-dd h:m:s
oryyyy-mm-dd
in the PDO isPDO::PARAM_STR
only remembering that the date has to be in the format that the bank accepts ...– novic