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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:11:23+00:00 2026-05-20T01:11:23+00:00

I have a Database that contains 4 tables, however I’m using 1 of them

  • 0

I have a Database that contains 4 tables, however I’m using 1 of them which is separated from the others.

In this table I have 4 fields which are varchar and the rest are ints (11 other fields), when the users fill up the DB everything gets saved correctly, however it has happened 3 times so far that the database values for the int’s reset to 0 without any apparent reason. At first, I thought, it was because those fields (where the numbers should go) were varchars not ints. However since I changed it, it happened again. I’ve already double checked my code and I have nothing that even updates or inserts a 0 value. Also I’m using codeigniter and active records which protect against SQL injections AND have XSS filtering enabled, could anyone point out something I might be missing or a reason for this to be happening?

Also, I’m pretty sure about the answer of this but, is there ANY way to recover some data?? Other than having to ask everyone to fill in everything again.. =/

** EDIT **

The Storage Engine is MyISAM and Collation is latin1_swedish_ci, Pack Keys are default, for all intents and purposes it’s a normal DB

** EDIT **

Here’s my Table Structure

-- phpMyAdmin SQL Dump
-- version 3.3.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 10, 2011 at 09:31 AM
-- Server version: 5.0.51
-- PHP Version: 5.2.14

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `cinesdec_prueba`
--

-- --------------------------------------------------------

--
-- Table structure for table `Oscar`
--

CREATE TABLE IF NOT EXISTS `Oscar` (
  `Id` int(20) NOT NULL auto_increment,
  `Nombre` varchar(100) default NULL,
  `ApPaterno` varchar(100) default NULL,
  `ApMaterno` varchar(100) default NULL,
  `Edad` varchar(25) default NULL,
  `Twitter` varchar(250) default NULL,
  `Correo` varchar(250) NOT NULL default '',
  `BestPicture` int(10) unsigned NOT NULL,
  `ActorLead` int(10) unsigned NOT NULL,
  `ActorSupport` int(10) unsigned NOT NULL,
  `ActressLead` int(10) unsigned NOT NULL,
  `ActressSupport` int(10) unsigned NOT NULL,
  `Art` int(10) unsigned NOT NULL,
  `Directing` int(10) unsigned NOT NULL,
  `Foreing` int(10) unsigned NOT NULL,
  `Music` int(10) unsigned NOT NULL,
  `Visual` int(10) unsigned NOT NULL,
  `Desempate` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`Correo`),
  UNIQUE KEY `Id` (`Id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=89 ;
  • 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-20T01:11:24+00:00Added an answer on May 20, 2026 at 1:11 am

    From what you’ve described, it sounds like your default value for the fields is 0.

    You may have created your table with the defaults in there, like so:

    `[column_name]` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'
    

    To remove the default, do the following:

    ALTER TABLE `[table_name]` CHANGE `[column_name]` `[column_name]` INT( 10 ) UNSIGNED NOT NULL;
    

    Which will remove the default 0 value (note the removal of DEFAULT '0').

    The reason you’re seeing the 0s: When the default value is 0, if your INSERT statements don’t include the field, MySQL will just insert the default value into the field.

    I’m guessing the software you used to create the table automatically added the 0 values, which typically aren’t a problem as any related table’s id would start at 1 which is the most common value for an integer value.

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

Sidebar

Related Questions

I have two simple tables in my database. A card table that contains Id,
I have a database that contains a table that looks a bit like this:
I have a database structure that has a Person table which contains fields such
I Have Database that contains 4 tables TABLE TBLCARTITEM (CART_ID, ITEM_ID, PROMOTION_ID, many more
I have a database that has two tables, one of which contains a foreign
I have a MySQL database that contains many tables, some of them created dynamically
I have a database table TravelRequest that contains, amongst other things, the fields SignOffName
I'm trying to normalize a mysql database.... I currently have a table that contains
I have data from a table in a database (string) that contain text and
I have a database that contains a date and we are using the MaskedEditExtender

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.