The UserId
field does not get updated with the value passed by the application, whereas all the other fields get updated.
This is my insert query and other related code from my app:
$sql = "INSERT INTO usermaster (UserId, UserName, Password,OwnerOrEmp, DBName, DeleteFlag, CreateDate, UpdateDate) values(:id, :userName, :password, :ownerOrEmp, :dBName, :deleteFlag, :createDate, :updateDate)";
$q = $pdo->prepare($sql);
//echo $uid;
$q->bindParam(':id', $uid);
$q->bindParam(':userName', $name);
$q->bindParam(':password', $pass);
$q->bindParam(':ownerOrEmp', $ownEmp);
$q->bindParam(':dBName', $dbName);
$q->bindParam(':deleteFlag', $delFlag);
$q->bindParam(':createDate', $curr_date);
$q->bindParam(':updateDate', $curr_date);
$q->execute();
This is how I create my table:
CREATE TABLE `USER_MASTER` (`UserID` varchar(8) NOT NULL,
`Password` varchar(10) NOT NULL,
`UserName` varchar(100) CHARACTER SET utf8 NOT NULL,
`OwnerOrEmp` char(1) NOT NULL,
`DBName` varchar(100) NOT NULL,
`DeleteFlag` char(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
And the result is