usar array_walk en una clase
| From: | Gerardo Benitez | Date: | Thu, 27 Sep 2007 20:01:37 +0000 |
| Subject: | usar array_walk en una clase | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-61470@lists.php.net to get a copy of this message | ||
Hola gente, alguno sabe como usar la funcion array_walk dentro de una clase?
estoy teniendo el problema que al llamarla me dice que no puede llamar a la
funcion que quiero que aplique al array.
este es el codigo que tengo
function actualizarDb($datos){
$sql = "update estructura_costos set ";
array_walk($datos,'$this->setUpdate'); //EL ERROR ME LO MARCA ACA
// array_walk()
[function.array-walk<http://localhost/initium/function.array-walk>]:
Unable to call $this->setUpdate() - function does not exist in
$sql .= implode(",",array_values($datos));
$sql .= " where id_estructura='$id' ";
echo $sql;
exit();
mysql_query($sql) or die(mysql_error());
}
function setUpdate(&$item, $key){
$item .= $key."=".$item;
}
--
Gerardo Benitez
----------------------------------------------------------------------
mercadoagil.com.ar
webseficientes.com.ar
tips y articulos para desarrolladores web
----------------------------------------------------------------------