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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:46:59+00:00 2026-05-19T01:46:59+00:00

I worked on a site locally through my Laptop. I have a table named

  • 0

I worked on a site locally through my Laptop. I have a table named blog and it has the fields post_id, title, markdown, author, added, and modified.

The fields Added and Modified are both DATETIME’s.

When a user makes a blog post, PHP runs this query successfully: INSERT INTO blog (title, author, markdown, added) VALUES ('BLA', 'BLA', 'BLA', NOW())

I’ve gone into phpMyAdmin and ran the exact same query with working results.

Now, I exported my exact database into the server today and I noticed that no posts were being stored in the DB, so I tried running it through phpMyAdmin’s SQL and it gave me the error Field 'modified' doesn't have a default value.

Why would this be happening? In my database, the default for both is None so I’m quite confused on what could be causing this.

My Laptop has PHP 5.3.1 and MySQL 5.1.41 (I installed XAMPP.)
The Server has PHP 5.3.5 and MySQL 5.5.8 (Out of desperation I installed the newest versions. The server was originally running MySQL 5.1 and a lower version of PHP.)

This has been killing me, hopefully someone knows what’s wrong with this or how to fix it.

Edit: Here are the SHOW CREATE TABLE blog results.

Laptop:

| blog  | CREATE TABLE `blog` (
  `post_id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `title` varchar(160) NOT NULL,
  `author` varchar(100) NOT NULL,
  `markdown` longtext NOT NULL,
  `added` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY (`post_id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 |

Server:

| blog  | CREATE TABLE `blog` (
  `post_id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `title` varchar(160) NOT NULL,
  `author` varchar(100) NOT NULL,
  `markdown` longtext NOT NULL,
  `added` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY (`post_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |

Auto Increments are different because of my tests.

  • 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-19T01:47:00+00:00Added an answer on May 19, 2026 at 1:47 am
    ALTER TABLE blog CHANGE modified modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP; 
    

    Or, more rarely, you might have a buggy version of MySQL on your server.

    *I might have the syntax imperfect, I referred to the last comment on ALTER TABLE at the bottom of the manual page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Something strange happened on my local laptop: my web site that worked locally for
I have moved a wordpress site from /wordpress/ to / and it has worked
I have a file download code in my site which worked perfectly fine untill
I have a MVC web site that worked well, until I moved it into
I have magento installed in a subdirectory. www.domain.com/subdir/magento This site worked perfectly at one
i have a client site www.noozhoo.com which worked fine on browser in PC or
Oooops I did it again. My site worked perfectly locally My development machine is
Earlier i worked with my site through FTP client and all my files had
I am working with a pre-existing zen-cart site has been worked on over the
My site worked fine on my other hosting but now I have uploaded this

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.