|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-30 08:19 UTC] jani@php.net
[2009-05-08 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 06:00:01 2025 UTC |
Description: ------------ when i try to execute a statement in mysql apache crashed. it did always work but does nothing. The reason i found was i trien the query that couses this in mysql and it gaves an error like this: ERROR 1364(HY000):Field 'status' does not have a default value but php crashes when it executes this query. Reproduce code: --------------- php version:5.2.2 mysql version: 5.0.41 apache version:1.3.37 i have table in like: CREATE TABLE `hu_properties` ( `prop_id` int(10) unsigned NOT NULL auto_increment, `property` varchar(255) default NULL, `user_id` int(10) NOT NULL, `generate_date` datetime NOT NULL, `generated` int(10) NOT NULL, `regenerate_date` datetime default NULL, `status` bigint(20) unsigned NOT NULL default NULL, PRIMARY KEY (`prop_id`), UNIQUE KEY `property` (`property`) ) ENGINE=MyISAM AUTO_INCREMENT=60 DEFAULT CHARSET=utf8; php code: $PDO = new PDO( $dsn, 'username', 'password' ); $insertStmt='INSERT INTO hu_properties (property, user_id, generate_date, generated) VALUES (?, ?, NOW(), 1)'; $sth=PDO->prepare($insertStmt); $result=$sth->execute(array('crazy', 1)); if($result) { echo 'OK'; } else { print_r($PDO->errorInfo()); } Expected result: ---------------- expected to give an error if the $result returns FALSE Actual result: -------------- apache server crashed (i think waiting reponse from php becouse mysql server works fine at this time)