--TEST-- Test for inserting and retrieving encrypted data of money types --DESCRIPTION-- Use PDOstatement::bindParam with all PDO::PARAM_ types --SKIPIF-- --FILE-- new BindParamOp(1, (string)$inputValues[0], $pdoParamType), "c_rand" => new BindParamOp(2, (string)$inputValues[1], $pdoParamType)), "prepareBindParam", $r); if (!isColEncrypted()) { if ($r === false) { echo "$pdoParamType should be compatible with $dataType.\n"; $success = false; } else { $sql = "SELECT * FROM $tbname"; $stmt = $conn->query($sql); $row = $stmt->fetch(PDO::FETCH_ASSOC); if (($row["c_det"] != $inputValues[0] || $row["c_rand"] != $inputValues[1]) && $pdoParamType != "PDO::PARAM_NULL") { echo "Incorrect output retrieved for datatype $dataType.\n"; var_dump($inputValues); var_dump($row); $success = false; } } } else { if ($r === false) { if ($stmt->errorInfo()[0] != "22018") { echo "Incorrect error returned.\n"; $success = false; } } else { echo "$dataType is not compatible with any type.\n"; $success = false; } } $conn->query("TRUNCATE TABLE $tbname"); } if ($success) { echo "Test successfully done.\n"; } dropTable($conn, $tbname); } unset($stmt); unset($conn); } catch (PDOException $e) { echo $e->getMessage(); } ?> --EXPECT-- Testing smallmoney: Test successfully done. Testing money: Test successfully done.