Insert statement in Insert-php+mysql, why should there be a space before time

Source: Internet
Author: User
Keywords Insert PHP mysqli
Insertphpmysqli

The data table is as follows:

#
Name
Type
Collation
Attributes
Null
Default
Extra
Action

1
Id
Int (10)

UNSIGNED
No
None
Auto_increment
Change
Drop
More

2
Author
CHAR (20)
Utf8_general_ci

No
None

Change
Drop
More

3
Addtime
Datetime

No
None

Change
Drop
More

4
Content
varchar (100)
Utf8_general_ci

No
None

Change
Drop
More

5
Reply
varchar (100)
Utf8_general_ci

No
None

Change
Drop
More
Check allwith selected:browse Change Drop Primary Unique Index

Print View Relation View propose table structure Move columns

ADD column (s) at End of table at Beginning of table Afteridauthor addtimecontentreply

    • Indexesinformationspace Usagedata16kibindex0btotal16kibrow Statisticsformatcompactcollationutf8_general_cinext AUTOINDEX2CREATIONAPR at 10:51 AM

1. Write time only.
$sql = "INSERT into message ( addtime ,) VALUES (' 2015-04-22 08:33:46 ')";
Can be written with the following results:

Id
Primary key, auto-grow
Author
Author
Addtime
Message time
Content
Message content
Reply
Reply

Edit
Copy
Delete
1

2015-04-22 08:33:46

2. Follow the form to fill in the message.
$sql = "INSERT into message ( author , addtime , content ) VALUES (' $name ', ' $addtime ', ' $content ')";
Can write normally, let me puzzled is addtime addtime in front of why must have space?

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.