Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9052913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:17:47+00:00 2026-06-16T13:17:47+00:00

I have a database table timetable with a DATETIME field called created_on . created_on

  • 0

I have a database table timetable with a DATETIME field called created_on.

created_on DATETIME,
notes VARCHAR(255) NOT NULL

I use the NOW() function to insert the current time through PDO prepared statements.

INSERT INTO timetable(created_on, note)
VALUES(?, ?);

So after binding the values and executing the prepared statement…

$notes ="This is a note...";
$values =array("NOW()", $notes);
$stm->execute($values);

… the notes column in the MySQL table writes the expected data but the created_on column produces…

0000-00-00 00:00:00 

I don’t want to use the Unix epoch timestamp. So how do I get DATETIME in the NOW() function to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:17:48+00:00Added an answer on June 16, 2026 at 1:17 pm

    don’t pass NOW() as a parameter,

    INSERT INTO timetable(created_on, note) VALUES(NOW(), ?);
    

    so you will only need to bind the notes.

    $values =array($notes);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table containing dates (`date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00').
I have a table valued function called split in my database and I want
I have Database table of Questions. I use the integer variable Id to sort
I have database called wisherDB, and I have a table called tbltasks inside the
In MySql database have AM_TIMETABLE table in that UserId DateTime 101 2012-08-08 04:00:00 102
I have a database table as follows: create table Table1( Date varchar(10), Batch_Name varchar(50),
i have database table like this +-------+--------------+----------+ | id | ip | date |
that my problem: I have database table like that: id (AI) market_id 1 6
I have a database table with some rows that I want to fetch using
I have a database table, my goal is to read in each of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.