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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:22:56+00:00 2026-05-15T03:22:56+00:00

Hello i want to send to a MySQL data base a date and time

  • 0

Hello i want to send to a MySQL data base a date and time in a format compatible with the mysql DateTime format, wich is: 0000-00-00 00:00:00 …

Im using this code who brings the date and time from a PHP command:

   $insert = "INSERT INTO sms (ref, texto, fecha)
   VALUES ('".$_POST['usuario']."', '".$_POST['sms']."', '".date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000))."')";
   $add_member = mysql_query($insert);

I really want to do this but with a MySQL command, i mean, using the Date and Time from the mysql server. Thanks

  • 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-05-15T03:22:57+00:00Added an answer on May 15, 2026 at 3:22 am

    Use NOW() when inserting the record INSERT INTO table (date) VALUES (NOW())

    For your code:

    $insert = "INSERT INTO sms (ref, texto, fecha)
    VALUES ('".$_POST['usuario']."', '".$_POST['sms']."', NOW() )";
    $add_member = mysql_query($insert);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send HTML-emails, using Django templates like this: <html> <body> hello <strong>{{username}}</strong>
Hello I want to send a control to the front, but the only method
Considering MSMQ version 3.0 Hello. I want to send and read messages from a
I want to send a string Hello there, but I only get re. Why
I want to send a message to my computer from my phone using TCP..My
I want to send back formatted messages from my domain, For example things like:
i want to send xml file with userid and password over HTTPs and then
I want to send Corel Draw .CDR drawing binary files and XML SVG files
Hello I want write my own desktop sharing application in Java. The application should
I want to send a mail message with the SmtpClient class. Here's the code

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.