Default ID is inserting "0"
Hello,
I have made one module & inserting record..
Record is inserting properly.. But by default for first record it is inserting id as "0" (primary key) (Hence, I can't do delete/edit from admin)
Here is my table structure, & my model
My entity_medium_model.php
require_once(FUEL_PATH.'models/base_module_model.php');
class Entity_medium_model extends Base_module_model {
public $required = array('medium_name');
function __construct()
{
parent::__construct('entity_medium');
}
}
CREATE TABLE `aks_medium` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`medium_name` varchar(50) NOT NULL,
`published` enum('yes','no') NOT NULL default 'yes',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
Comments
I have inserted 2 records, and on list page when I mouse over on "edit" link then both id are same.. both are "1" number id.. while, I have checked in DB then it was ok..
in DB it was 1 & 2 orderwise.. So definitely it's something cache or request/response problem.
Follow the below Steps..
first truncate the table
Create new record,
Go to list page.. Click again on "create"
Insert again another record
Go to list page and now check with mouse over on "Edit" link