|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-22 22:31 UTC] tony2001@php.net
[2005-11-30 01:00 UTC] php-bugs at lists dot php dot net
[2005-12-03 01:03 UTC] bill dot finn at sellingsource dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 20:00:01 2025 UTC |
Description: ------------ Performing an update into a non-null longtext column using prepare syntax. Example code works in php 5.0.x. Upgraded to 5.1.x and it started entering variations of empty strings, 0, or 0000-00-00 depending on how much data I was trying to enter. In a test that allows null values, it enters null. (mysql 5.0.13 && mysql 5.0.15) Reproduce code: --------------- CREATE TABLE test (col1 longtext not null); <?php $data = "whatever, some string"; $mysqli = new mysqli( HOST, USER, PASS, DB, PORT ); $query = "INSERT INTO test SET col1 = ?"; $prepared = $mysqli->prepare( $query ); $prepared->bind_param('s', $data ); $prepared->execute(); $prepared->close(); ?> Expected result: ---------------- contents of $data inserted into col1 of table. Actual result: -------------- SELECT col1 FROM test shows one of three things: 0000-00-00 0 empty string