How to make second column increment if one column is already auto incremented?
23:33 24 Sep 2016

I have three columns ID, Receipt_no, Name in my table. ID is the primary key (auto incremented), so ID will start from 1, same thing I have to set on receipt_no so it will also start from 1. Is this possible?

I am using phpmyadmin.

Thanks in advance.

-- Table structure for table `temp`
--

CREATE TABLE IF NOT EXISTS `temp` (
`Id` int(11) NOT NULL,
  `Receipt_no` int(11) NOT NULL,
  `Name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


ALTER TABLE `temp`
 ADD PRIMARY KEY (`Id`), ADD UNIQUE KEY `Receipt_no` (`Receipt_no`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `temp`
--
ALTER TABLE `temp`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
mysql