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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:11:43+00:00 2026-05-28T02:11:43+00:00

I’m working on a codeigniter project and I’m trying to troubleshoot a sql issue.

  • 0

I’m working on a codeigniter project and I’m trying to troubleshoot a sql issue. I have a query that updates a date field in my table and it’s not updating it at all.

I have this table

CREATE TABLE `Customer` (
  `customer_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `first_name` varchar(55) NOT NULL DEFAULT '',
  `last_name` varchar(55) NOT NULL DEFAULT '',
  `city` varchar(255) DEFAULT '',
  `state` char(2) DEFAULT '',
  `zip` int(5) DEFAULT NULL,
  `title` varchar(255) NOT NULL DEFAULT '',
  `image` varchar(255) DEFAULT '',
  `blurb` blob,
  `end_date` date DEFAULT NULL,
  `goal` int(11) DEFAULT NULL,
  `paypal_acct_num` int(11) DEFAULT NULL,
  `progress_bar` enum('full','half','none') DEFAULT NULL,
  `page_views` int(11) NOT NULL DEFAULT '0',
  `total_pages` int(11) NOT NULL DEFAULT '0',
  `total_conversions` int(11) NOT NULL DEFAULT '0',
  `total_given` int(11) NOT NULL DEFAULT '0',
  `conversion_percentage` int(11) NOT NULL DEFAULT '0',
  `avg_contribution` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`customer_id`)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

and when I run this query to insert data, it runs fine and sets the date to 2012-11-01

INSERT INTO `Customer` (`first_name`, `last_name`, `end_date`) VALUES ('John', 'Smith2', '2012-11-01');

Then I get the customer_id and try to run this query

UPDATE `Customer` SET `end_date` = '2012-14-01' WHERE `customer_id` = '18';

and it sets the date end_date field to 0000-00-00.

Why is it changing the end date to 0000-00-00 rather than 2012-14-01?

  • 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-28T02:11:43+00:00Added an answer on May 28, 2026 at 2:11 am

    2012-14-01 is first day of fourteenth month 🙂

    (so its invalid date, thus casted to 0000-00-00 and Data truncated for column 'end_date' at row 1 warning was returned by mysql, which you can see by querying SHOW WARNINGS to mysql immediately after badly behaving query)

    2012-01-14 is 14th of January.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't

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.