Changeset 1683
- Timestamp:
- 01/05/2008 05:45:18 PM (11 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/drivers/Database_Mysqli.php
r1677 r1683 470 470 protected $link = NULL; 471 471 protected $stmt; 472 protected $var_names; 473 protected $var_values; 472 474 473 475 public function __construct($sql, $link) … … 486 488 487 489 // Sets the bind parameters 488 public function bind_params() 489 { 490 $argv = func_get_args(); 491 return $this; 492 } 493 494 // sets the statement values to the bound parameters 495 public function set_vals() 496 { 490 public function bind_params($param_types, $params) 491 { 492 $this->var_names = array_keys($params); 493 $this->var_values = array_values($params); 494 call_user_func_array(array($this->stmt, 'bind_param'), array_merge($param_types, $var_names)); 495 497 496 return $this; 498 497 } … … 501 500 public function execute() 502 501 { 503 return $this; 502 foreach ($this->var_names as $key => $name) 503 { 504 $$name = $this->var_values[$key]; 505 } 506 $this->stmt->execute(); 507 return $this->stmt; 504 508 } 505 509 }
