Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql warnings
    text
    copied!<p>I have the following table:</p> <pre><code> CREATE TABLE `events` ( `evt_id` int(11) NOT NULL AUTO_INCREMENT, `evt_name` varchar(50) NOT NULL, `evt_description` varchar(100) DEFAULT NULL, `evt_startdate` date NOT NULL, `evt_enddate` date DEFAULT NULL, `evt_starttime` time DEFAULT NULL, `evt_endtime` time DEFAULT NULL, `evt_amtpersons` int(11) DEFAULT NULL, `sts_id` int(11) NOT NULL, `adr_id` int(11) DEFAULT NULL, `evt_amtPersonsSubs` int(11) DEFAULT NULL, `evt_photo` varchar(50) DEFAULT NULL, `sys-mut-dt` timestamp NULL DEFAULT NULL, `sys-mut-user` varchar(20) DEFAULT NULL, `sys-mut-id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`evt_id`), KEY `sts_id` (`sts_id`), KEY `adr_id` (`adr_id`), CONSTRAINT `sts_id` FOREIGN KEY (`sts_id`) REFERENCES `statusses` (`sts_id`) O N DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 </code></pre> <p>Now I have got two problems: </p> <p>Here is my query:</p> <pre><code>INSERT INTO `events`(`evt_name` , `evt_description` , `evt_startdate` , `evt_enddate` , `evt_starttime` , `evt_endtime` , `evt_amtpersons` , `sts_id` , `adr_id` , `evt_amtPersonsSubs` , `evt_photo` , `sys-mut-user` , `sys-mut-id`) VALUES ('asf' , 'asf' , '2009-04-02' , '2009-04-22' , '00:00:00' , '00:00:00' , '3' , '1' , '' , '' , '' , 'test' , '1') </code></pre> <ol> <li><p>When I execute this query through my php programs I get no error. But when I execute the query in a shell directly on the mysql database I get two warnings. How can I get PHP to alert me when there are warnings because if there are warnings mysql doesn't do the insert.</p></li> <li><p>About the warnings:</p></li> </ol> <p>| Warning | 1366 | Incorrect integer value: '' for column 'adr_id' at row 1 | Warning | 1366 | Incorrect integer value: '' for column 'evt_amtPersonsSubs' a t row 1 </p> <p>How can I get rid of these warnings. Tried to make some changes but it didn't work out so far.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload