本文整理汇总了PHP中ADOdb_Active_Record::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP ADOdb_Active_Record::Load方法的具体用法?PHP ADOdb_Active_Record::Load怎么用?PHP ADOdb_Active_Record::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADOdb_Active_Record
的用法示例。
在下文中一共展示了ADOdb_Active_Record::Load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Load
public function Load($where = null, $bindarr = false, $lock = false)
{
if (is_numeric($where)) {
$where = $this->_prefix . "id = " . $where;
}
$ret = parent::Load($where, $bindarr, $lock);
if ($ret && $this->has_meta()) {
$this->load_meta($this);
}
return $ret;
}
示例2: editarRegistro
public function editarRegistro()
{
$this->usarScaffold();
//Conectarse a la base de datos
if ($this->db == "") {
$this->db = "default";
}
$conexion = $this->nucleo->getConexion($this->db);
$conexion->Execute("SET NAMES utf8");
//Primarias en $primarias
//Demas campos en $campos
$campos = $this->getCampos();
$registro = new ADOdb_Active_Record($this->modelo);
$where = "";
foreach ($campos as $c) {
if ($c["primaria"] == 1) {
if ($where != "") {
$where .= " AND ";
}
$where .= $c["nombre"] . "=" . $this->par['pri_' . $c["nombre"]];
}
}
$registro->Load($where);
foreach ($campos as $c) {
if ($c["auto"] == 1) {
} elseif ($c["nombre"] == "password" || $c["nombre"] == "contrasena") {
if ($this->par[$c["nombre"]] != "") {
$registro->{$c}["nombre"] = md5($this->par[$c["nombre"]]);
}
} elseif ($c["nombre"] == "texto") {
$registro->{$c}["nombre"] = stripslashes($this->par[$c["nombre"]]);
} else {
$registro->{$c}["nombre"] = $this->par[$c["nombre"]];
}
}
if ($registro->Save()) {
$this->set("editado", "1");
$this->listado();
$this->set("vista", "listado");
} else {
$this->set("editado", "0");
$this->agregar();
$this->set("vista", "agregar");
}
}