select nombre,nombre_comando,valor
from servidor S, configuracion C, configuracionservidor F
where F.id_servidor = S.id
and F.id_configuracion=C.id
This query works for me in Mysql
but at the moment of writing it in the model of codeigniter
I can not show the results of the query in the view
This function will show the information in the table [server configuration]
public function mostrarSerconf(){
$q= $this->db->get("select nombre,nombre_comando,valor from servidor,configuracion,configuracionservidor where configuracionservidor.id_servidor=servidor.id and configuracionservidor.id_configuracion=configuracion.id");
if($q->num_rows()>0){
return $q;
}else{
return false;
}
}
This is my driver
public function servConf(){
$datos = array('mostrar2'=> $this->modelo_principal->mostrarSerconf());
$this->load->view('servConf',$datos);
}
This is what I have in my sight
<?php
if ($mostrar2 == null) {
echo
"<h3>"."SIN INFORMACÓN PARA MOSTRAR"."</h3>";
}else{
foreach ($mostrar2->result() as $fila) {
echo "<tr>";
echo "<td>"."<b>".$fila->id."</b>"."</td>";
echo "<td>"."<center>".$fila->id_servidor."</center>"."</td>";
echo "<td>"."<center>".$fila->id_configuracion."</center>"."</td>";
echo "<td>".$fila->valor."</td>";
echo "<td>"."<a href=".base_url()."principal/editarServi/".$fila->id.'>Editar</a></td>';
echo "<td>"."<a href=".base_url()."principal/eliminarServi/".$fila->id.'>Eliminar</a></td>';
echo "</tr>";
}
}
?>