return true;
}
+ /**
+ * Very ugly hack which emulates bound parameters in mssql queries
+ * where params not supported (UpdateBlob) :-(
+ */
+ protected function emulate_bound_params($sql, array $params=null) {
+ if (empty($params)) {
+ return $sql;
+ }
+ /// ok, we have verified sql statement with ? and correct number of params
+ $return = strtok($sql, '?');
+ foreach ($params as $param) {
+ if (is_bool($param)) {
+ $return .= (int)$param;
+ } else if (is_null($param)) {
+ $return .= 'NULL';
+ } else if (is_numeric($param)) {
+ $return .= $param;
+ } else {
+ $param = $this->db->qstr($param);
+ $return .= "$param";
+ }
+ $return .= strtok('?');
+ }
+ return $return;
+ }
}
return ($returnid ? $id : true);
}
-
- /**
- * Very ugly hack which emulates bound parameters in mssql queries
- * where params not supported (UpdateBlob) :-(
- */
- private function emulate_bound_params($sql, array $params=null) {
- if (empty($params)) {
- return $sql;
- }
- // ok, we have verified sql statement with ? and correct number of params
- $return = strtok($sql, '?');
- foreach ($params as $param) {
- if (is_bool($param)) {
- $return .= (int)$param;
- } else if (is_null($param)) {
- $return .= 'NULL';
- } else if (is_numeric($param)) {
- $return .= $param;
- } else {
- $param = $this->db->qstr($param);
- $return .= "$param";
- }
- $return .= strtok('?');
- }
- return $return;
- }
-
}
return true;
}
- /**
- * Very ugly hack which emulates bound parameters in mssql queries
- * where params not supported (UpdateBlob) :-(
- */
- private function emulate_bound_params($sql, array $params=null) {
- if (empty($params)) {
- return $sql;
- }
- // ok, we have verified sql statement with ? and correct number of params
- $return = strtok($sql, '?');
- foreach ($params as $param) {
- if (is_bool($param)) {
- $return .= (int)$param;
- } else if (is_null($param)) {
- $return .= 'NULL';
- } else if (is_numeric($param)) {
- $return .= $param;
- } else {
- $param = $this->db->qstr($param);
- $return .= "$param";
- }
- $return .= strtok('?');
- }
- return $return;
- }
-
/**
* This function is used to convert all the Oracle 1-space defaults to the empty string
* like a really DIRTY HACK to allow it to work better until all those NOT NULL DEFAULT ''
public function sql_cast_char2int($fieldname, $text=false) {
return ' CAST(' . $fieldname . ' AS INT) ';
}
-
- /**
- * Very ugly hack which emulates bound parameters in pg queries
- * where params not supported :-(
- */
- private function emulate_bound_params($sql, array $params=null) {
- if (empty($params)) {
- return $sql;
- }
- // ok, we have verified sql statement with ? and correct number of params
- $return = strtok($sql, '?');
- foreach ($params as $param) {
- if (is_bool($param)) {
- $return .= (int)$param;
- } else if (is_null($param)) {
- $return .= 'NULL';
- } else if (is_numeric($param)) {
- $return .= $param;
- } else {
- $param = $this->db->qstr($param);
- $return .= "$param";
- }
- $return .= strtok('?');
- }
- return $return;
- }
}