From 3c74f243fe942488ea0d6ffa74ff69f51483f300 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Wed, 18 Apr 2012 10:39:01 -0400 Subject: [PATCH] Implement more of PDOStatement in Firebird_Result class --- drivers/firebird/firebird_result.php | 98 +++++++++++++++++++++------ tests/db_files/FB_TEST_DB.FDB | Bin 802816 -> 802816 bytes 2 files changed, 77 insertions(+), 21 deletions(-) diff --git a/drivers/firebird/firebird_result.php b/drivers/firebird/firebird_result.php index c209bd6..15f6dfa 100644 --- a/drivers/firebird/firebird_result.php +++ b/drivers/firebird/firebird_result.php @@ -31,6 +31,71 @@ class Firebird_Result extends PDOStatement { { $this->statement = $link; } + + // -------------------------------------------------------------------------- + + /** + * Invalidate method for data consistency + * + * @param mixed $column + * @param mixed &$param + * @return FALSE + */ + public function bindColumn($column, &$param, $type=NULL, $maxlen=NULL, $driverdata=NULL) + { + return FALSE; + } + + // -------------------------------------------------------------------------- + + /** + * Invalidate method for data consistency + * + * @param mixed $parameter + * @param mixed &$variable + * @param int $data_type + * @return FALSE + */ + public function bindParam($parameter, &$variable, $data_type=NULL, $maxlen=NULL, $driverdata=NULL) + { + return FALSE; + } + + // -------------------------------------------------------------------------- + + /** + * Invalidate method for data consistency + * + * @param mixed $parameter + * @param mixed &$variable + * @param int $data_type + * @return FALSE + */ + public function bindValue($parameter, $variable, $data_type=NULL) + { + return FALSE; + } + + // -------------------------------------------------------------------------- + + /** + * Run a prepared statement query + * + * @param array $args + * @return bool + */ + public function execute($args = NULL) + { + //Add the prepared statement as the first parameter + array_unshift($args, $this->statement); + + // Let php do all the hard stuff in converting + // the array of arguments into a list of arguments + // Then pass the resource to the constructor + $this->__construct(call_user_func_array('fbird_execute', $args)); + + return $this; + } // -------------------------------------------------------------------------- @@ -101,27 +166,6 @@ class Firebird_Result extends PDOStatement { // -------------------------------------------------------------------------- - /** - * Run a prepared statement query - * - * @param array $args - * @return bool - */ - public function execute($args = NULL) - { - //Add the prepared statement as the first parameter - array_unshift($args, $this->statement); - - // Let php do all the hard stuff in converting - // the array of arguments into a list of arguments - // Then pass the resource to the constructor - $this->__construct(call_user_func_array('fbird_execute', $args)); - - return $this; - } - - // -------------------------------------------------------------------------- - /** * Return the number of rows affected by the previous query * @@ -143,6 +187,18 @@ class Firebird_Result extends PDOStatement { { return count($this->fetchAll()); } + + // -------------------------------------------------------------------------- + + /** + * Method to emulate PDOStatement->errorCode + * + * @return string + */ + public function errorCode() + { + return fbird_errcode(); + } // -------------------------------------------------------------------------- diff --git a/tests/db_files/FB_TEST_DB.FDB b/tests/db_files/FB_TEST_DB.FDB index c75f825bbc0d786f4a863f4c83f74b411ea2825b..25cbbeb7ccd4408d277f4692271fc14678fbf2f2 100644 GIT binary patch delta 1019 zcmZ9KJ%|%g5Xa~3ZcNN@-V+g&#oHvCxOWCgLe#@6#25=j@B_qB4&f~1iYvrIEEbFH z6ve|qY;CR+Jue7{otW6TlWA?@B?6}=W760r#}Vv4ww%#SbWb8gyOaCz0S|R8o#e2ts-qj+K#jn z=~Se5MLHenOr&?O=&YmFbSst1eoj9*t<$ZwAnRqKYIdcH&dck2(k8d8*VH~(Rwa1k z6yTR#f@LQMXPrrKY_|3ow5J{)76W4mZg!UFFVS)a2?gH$in7<^H!8*MzJ z_V$Z!CkLa00^#X#X~I0#i>gQqL6qWKTolq%Wd{ zD_XdIg5w*GPw&4n$EWi#*W>p&0jy+B9MRG@(ZcZ(9B;s}Jdf^t;}heV zg1nJ}@@7C1C?L@S5-kIA6Cl@sT#pX_V32Dj_}5MB9>&4L6Py#2kbq;K54mK|Gcq=&8pl9v3NlszO0{ z2TyuZ5fuL<7xCsz(Tf)mX_}^5v00Q}v`Br~-G^monfdmc+4p`s^TzY$Ja2A6!Rgvk z8U8noo*BE5PL%+TatAQf-A@1)Pra{RD?}e?F!*VQM)5dRdVZq)%(hHCq~AZ(DvX+o@sd>C&&UD7B22R329C3Ve2^ z;e}IyHOGZzrwr%0yF6ELY}m`qzz6ORaxSd0uH(!CvQH6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