stevoh Posted December 21, 2005 Share Posted December 21, 2005 Hello, I keep recieving the following error: "The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value" everytime I try and enter a date in the format of 12/05/2005 into my DB. my code looks like //Grab date for entry into database $day = date("j"); $month = date("n"); $year = date("Y"); $date = date('d/m/Y', mktime(0, 0, 0, $month, $day, $year)); // Retrieve answer to question 1 and display $booking = $_POST['holdingName1']; echo ("<b>$booking</b>"); // query to add sigle answered form data into database $insert_query = "INSERT INTO answers (id, qid, surveyNum, answer, date) VALUES ('$var', '1', '1', '$booking', '$date')"; $result = odbc_exec($connection, $insert_query); $date returns the format stated above but it wont allow me to enter itno the DB...WHY!!!!! Please...Please...someone help Best Regards Stevoh Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.