Variable number of parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is it possible to grab a variable number of parameters and send the appropriate amount to another function?

<?php
// Some class
$this->db->prepare("SELECT * FROM `table` WHERE (`id`=?)");
$this->db->bind('ii', $id1);

$this->db->prepare("SELECT * FROM `table` WHERE (`id`=? AND `other_id`=?)");
$this->db->bind('ii', $id1, $id2);

// DB class
function bind () {
  $args = func_get_args();
  $this->statement->bind_param($args[0], $args[1], ...);
}
?>

Ok, is it possible to send any number of variables to db->bind() in order to send those to statement->bind_param()?

Or, if someone else has a better db abstraction method, feel free to educate...

Thanks,
~Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux