Commit 2191bf3b authored by Jeffrey Way's avatar Jeffrey Way

Tinkering

parent f90b4ab8
...@@ -121,25 +121,24 @@ class MysqlDB { ...@@ -121,25 +121,24 @@ class MysqlDB {
* @return string The joined parameter types. * @return string The joined parameter types.
*/ */
protected function _determineType($item) { protected function _determineType($item) {
$param_type = array();
switch (gettype($item)) { switch (gettype($item)) {
case 'string': case 'string':
$param_type[] = 's'; $param_type = 's';
break; break;
case 'integer': case 'integer':
$param_type[] = 'i'; $param_type = 'i';
break; break;
case 'blob': case 'blob':
$param_type[] = 'b'; $param_type = 'b';
break; break;
case 'double': case 'double':
$param_type[] = 'd'; $param_type = 'd';
break; break;
} }
return implode($param_type); return $param_type;
} }
...@@ -208,7 +207,6 @@ class MysqlDB { ...@@ -208,7 +207,6 @@ class MysqlDB {
$this->_query .= '(' . implode($keys, ', ') . ')'; $this->_query .= '(' . implode($keys, ', ') . ')';
$this->_query .= ' VALUES('; $this->_query .= ' VALUES(';
while ( $num !== 0 ) { while ( $num !== 0 ) {
($num !== 1) ? $this->_query .= '?, ' : $this->_query .= '?)'; ($num !== 1) ? $this->_query .= '?, ' : $this->_query .= '?)';
$num--; $num--;
...@@ -231,7 +229,6 @@ class MysqlDB { ...@@ -231,7 +229,6 @@ class MysqlDB {
foreach ($tableData as $prop => $val) { foreach ($tableData as $prop => $val) {
$args[] = &$tableData[$prop]; $args[] = &$tableData[$prop];
} }
call_user_func_array(array($stmt, 'bind_param'), $args); call_user_func_array(array($stmt, 'bind_param'), $args);
} }
...@@ -263,9 +260,9 @@ class MysqlDB { ...@@ -263,9 +260,9 @@ class MysqlDB {
call_user_func_array(array($stmt, 'bind_result'), $parameters); call_user_func_array(array($stmt, 'bind_result'), $parameters);
while ($stmt->fetch()) { while ( $stmt->fetch() ) {
$x = array(); $x = array();
foreach ($row as $key => $val) { foreach ( $row as $key => $val ) {
$x[$key] = $val; $x[$key] = $val;
} }
$results[] = $x; $results[] = $x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment