Welcome Guest, Not a member yet? Register   Sign In
get single record?
#1

[eluser]mohsin917[/eluser]
Hello guys..

I have a query which return me a single record.. only the name of user

Code:
$query = $this->db->query("SELECT name FROM sc_userinfo where id = '11'");
        
        foreach($query->result as $row)
        {
            echo $row->name;
        }

Now by the foreach loop I can get that record..

but it is a single record any other quick code to get that record??
#2

[eluser]davidbehler[/eluser]
Code:
$query = $this->db->query("SELECT name FROM sc_userinfo where id = '11'");
        
echo $query->row()->name;




Theme © iAndrew 2016 - Forum software by © MyBB