Bug #69795 [Opn->Fbk]: PDO_ODBC + Vertica query fails when using parameters
Edit report at https://bugs.php.net/bug.php?id=69795&edit=1
ID: 69795
Updated by: cmb@php.net
Reported by: tob_filt at hotmail dot com
Summary: PDO_ODBC + Vertica query fails when using parameters
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO ODBC
Operating System: Linux Debian
PHP Version: 5.6.9
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Would you get any error messages, if you set
PDO::ATTR_ERRMODE to PDO::ERRMODE_EXCEPTION?
And please check with any of the actively supported PHP versions:
<https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2015-06-10 20:09:42] tob_filt at hotmail dot com
Description:
------------
We're trying to use PDO to connect to a Vertica database and it works as long as we don't
put parameters in our queries. For example, a simple query like this works no problem:
$stmt = $conn->prepare("Select Name from clients where ClientNum = 123");
However, when I do it like this, I get a blank page:
$stmt = $conn->prepare("Select Name from clients where ClientNum = :cl");
$stmt->bindValue(":cl", 123);
Test script:
---------------
$c = new PDO("odbc:Driver=Vertica;Server=X.X.X.X;Port=5433;Database=db;",
"myUser", "myPassword");
$stmt = $c->prepare("SELECT ClientName FROM tblClients where ClientNum = :cl");
$stmt->bindValue(":cl", 123);
$stmt->execute();
while($res = $stmt->fetch(PDO::FETCH_ASSOC))
{
echo $res['ClientName'] . "<br>";
}
Expected result:
----------------
I expect the name of the client to get displayed
Actual result:
--------------
A blank page
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69795&edit=1
Thread (3 messages)