Welcome Guest, Not a member yet? Register   Sign In
How to insert NOW() in DATETIME field
#4

Here is a helper method I wrote to do just that.

PHP Code:
// -----------------------------------------------------------------------

/**
 * Method for MySQLi NOW()
 */
if ( ! function_exists('now'))
{
    
/**
     * -------------------------------------------------------------------
     * now ()
     * -------------------------------------------------------------------
     *
     * @return string
     */
    
function now() : string
    
{
        return 
date("Y-m-d H:i:s");
    }

What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
How to insert NOW() in DATETIME field - by keop - 09-29-2020, 12:17 AM
RE: How to insert NOW() in DATETIME field - by InsiteFX - 09-29-2020, 11:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB