开发者

entering retrieved datas to database

I have a php form with three text boxes (webmeasurementsuiteId, webmeasurementsId, Id) and the values in the text boxes are retrieved from other tables of the database. Now my task is to submit the retrieved values in this php form named (mapping) to the database. I have created the table with the following syntax:

CREATE TABLE `mapping` (
  `webmeasurementsuiteId` INT NOT NULL,
  `webmeasurementsId` INT NOT NULL,
 开发者_如何学JAVA `Id` INT NOT NULL,
  PRIMARY KEY (Id)
);

But I am getting an sql error as follows:

INSERT INTO mapping(webmeasurementsuiteId,webmeasurementsId,Id) values ('','','7')

ERROR: Incorrect integer value: '' for column 'webmeasurementsuiteId' at row 1

Can anyone correct my error? plz view my coding in this link http://pastebin.com/LELEhRCX


try e.g.

INSERT INTO mapping(webmeasurementsuiteId,webmeasurementsId,Id) values ('1','2','7')

and feel the difference

first two columns are declared as int not null, they can not accept not int and null values

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜