Welcome Guest, Not a member yet? Register   Sign In
how to output MySQL query results?
#1

[eluser]Tony W[/eluser]
In my controller, I have the following code:

Code:
$query = $this->db->query("SELECT example FROM slang WHERE `slang` =' $slang_input' ");
    

      
      foreach ($query->result() as $row)
      {
        echo $row->example;
      }

I wonder how to output the $row->example better? There might be lots of results for this query, maybe I should make it an array and pass it to the view file?

thanks


Messages In This Thread
how to output MySQL query results? - by El Forum - 07-10-2008, 10:53 PM
how to output MySQL query results? - by El Forum - 07-11-2008, 01:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB