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 8170783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:14:45+00:00 2026-06-06T21:14:45+00:00

Using Doctrine DBAL, I have some code that inserts a new row into the

  • 0

Using Doctrine DBAL, I have some code that inserts a new row into the main database from a form values binded as $telephone_international and $surname.

After that is done, it inserts a new record into a duplicate database. $app['dbs']['backup']

If that’s successful, the entry inserted previously the main database gets its copied value updated. The copied column is a timestamp, default value is 0, but the following code should change it to the current time.

$app['dbs']['main']->update('phonebook', array(
    'mediated'  => 'NOW()'
), array(
    'telephone' => $telephone_international, 
    'surname'   => $surname
));

But the value is still 0000-00-00 00:00:00. I wonder if 'NOW()' is being treated as a string.

  • 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-06T21:14:46+00:00Added an answer on June 6, 2026 at 9:14 pm

    As i proposed in the comments above, this seems the way to go, as stated here:
    http://doctrine-orm.readthedocs.org/en/2.0.x/cookbook/working-with-datetime.html

    So try like this:

    $app['dbs']['main']->update('phonebook', array(
        'mediated'  => new \DateTime("now")
    ), array(
        'telephone' => $telephone_international, 
        'surname'   => $surname
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using Doctrine 2 for a new project and have run into an
I'm using the Doctrine DataBase Abstraction Layer (DBAL) to perform some queries. For some
I am currently using Doctrine's DBAL library for MySQL interfacing and have currently built
Using Doctrine 2 I want to get some users that are contacts of another
Using Doctrine 1.2, I am having some issues deleting items from a Doctrine_Collection. I
Using Doctrine 2. I have an entity called 'size' and I'm trying to form
I am using Doctrine 2 entities. We have some entities which have to update
Im using Doctrine and i dont quite understand this code here: $this->hasColumn('id', 'integer', 8,
I'm using Doctrine 2.2.0 together with Codeigniter. I'm new to Doctrine (or to ORM
I'm using Doctrine ODM with MongoDB. I have a product model like this: namespace

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.