Hızlı olsa da, hatalar mükemmel değildir! ile erişmeyi denemeden önce her zaman sonuç için kontrol edin ($query->num_rows() > 0)
En hızlı (en özlü) yolu: Esasen
$query = $this->db->get_where('Table', array('field' => $value));
echo(($query->num_rows() > 0) ? $query->first_row()->field : 'No Results');
aynı şekilde:
$query = $this->db->get_where('Table', array('field' => $value));
if($query->num_rows() > 0)
{
echo $query->first_row()->field;
}
else
{
echo 'No Results';
}
için çoklu alan kullanımı:
$query = $this->db->get_where('Table', array('field' => $value));
if ($query->num_rows() > 0)
{
$row = $query->row();
echo $row->title;
echo $row->name;
echo $row->body;
}
Detaylı cevap için teşekkürler! – skndstry