cougar23 Posted September 11, 2008 Share Posted September 11, 2008 I'm using PDO and trying to bind a date parameter. For example, my parameter is '2008-08-08' and I'm trying to set that as a parameter for more query but I get "Fatal error: Undefined class constant 'PARAM_DATE' ". Any ideas why I would be getting this error? Should I just pass the date as a STR type? Would MySQL convert that to a DATE automatically, as that's what the column type in the DB is? (NOTE: i have a $dbManager object that handles my connection and loops through binding parameters, etc) $query = 'update ADVISING_APPOINTMENT a set a.STUDENT = null where a.STUDENT = :studentId and a.APPT_DATE = :apptDate and a.APPT_START_TIME = :apptStartTime and a.APPT_END_TIME = :apptEndTime'; $queryHolders = array(':studentId', ':apptDate', ':apptStartTime', 'apptEndTime'); $params = array($studentId, $apptDate, $apptStartTime, $apptEndTime); $paramTypes = array(PDO::PARAM_INT, PDO::PARAM_DATE, PDO::PARAM_TIME, PDO::PARAM_TIME); $results = $dbManager->doPreparedStmt($query, $queryHolders, $params, $paramTypes); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.