note 105068 modified in mysqli-stmt.bind-result by danbrown

From: Date: Tue, 26 Jul 2011 16:13:32 +0000
Subject: note 105068 modified in mysqli-stmt.bind-result by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181894@lists.php.net to get a copy of this message
According to the above documentation: "Depending on column types bound variables can silently change to the corresponding PHP type. " if you specify a field as int (tinyint, mediumint, etc.) with zerofill property, it will be converted (silently) to PHP integer (erasing the leading zeros). In order to keep those leading zeros, one solution is to specify the field as decimal. Note that this only happens when using prepared statements and not when executing the query directly. --was-- According to the above documentation: "Depending on column types bound variables can silently change to the corresponding PHP type. " if you specify a field as int (tinyint, mediumint, etc.) with zerofill property, it will be converted (silently) to PHP integer (erasing the leading zeros). In order to keep those leading zeros, one solution is to specify the field as decimal. Note that this only happens when using prepared statements and not when executing the query directly. More info at: http://stackoverflow.com/questions/6825106/php-mysql-zerofill-is-lost-when-using-mysqli-prepare/6825470 http://php.net/manual/en/mysqli-stmt.bind-result.php

« previous php.notes (#181894) next »