PHP & MySQL: zerofill is lost when using mysqli->prepare()
问题 Using: MySQL 5.1 + PHP 5.3.5 MySQL: id in "table" is defined as: mediumint(6) zerofill not null I get the expected result when using: $mysqli->query("SELECT id FROM table WHERE id = 1"); while($row = $ret->fetch_array(MYSQLI_ASSOC)) $arr[] = $row; >>> $arr[0]["id"] = 000001 But not when I use prepared statement: $ret = $mysqli->prepare("SELECT id FROM table WHERE id = ?"); call_user_func_array(array($ret,"bind_param"),array("i",1)); $ret->execute(); $ret->store_result(); $meta = $ret->result