I tried to show the list of users in a listbox, but I have not managed to make it work. If I just want to show a field like the name, it works fine, but I need to show the name and the two surnames.
<?php
class mHorarios extends CI_Model
{
function __construct()
{
parent::__construct();
}
public function lista_usuarios (){
$this->db->select('CONCAT( pnombre, '.', apellido_pa , '.', apellido_ma) AS nombre');
$this->db->order_by('nombre', 'asc');
$usuarios = $this->db->get('usuarios');
if($usuarios->num_rows() > 0){
return $usuarios->result();
}
}
}
?>
I get the following error
A PHP Error was encountered
Severity: Notice Message: Undefined property: stdClass :: $ rut_usu Filename: users / vAdminister_Horarios.php Line Number: 73 Backtrace: File: C: \ xampp \ htdocs \ SAE \ application \ views \ users \ vAdministrar_Horarios.php Line: 73 Function: _error_handler File: C: \ xampp \ htdocs \ SAE \ application \ controllers \ cHorarios.php
A PHP Error was encountered
Severity: Notice Message: Undefined property: stdClass :: $ pname Filename: users / vAdminister_Horarios.php Line Number: 73 Backtrace: