Welcome Guest, Not a member yet? Register   Sign In
foreach need?
#5

[eluser]John_Betong[/eluser]
[quote author="rich.a.coy" date="1265664691"]Ahh! In this case I know it's only one because I set a limit of one in the query and I'm looking up a unique user_id.

Thanks![/quote]

From the User Manual:
Code:
row()

This function returns a single result row. If your query has more than one row, it returns only the first row. The result is returned as an object. Here's a usage example:

$query = $this->db->query("YOUR QUERY");

if ($query->num_rows() > 0)
{
   $row = $query->row();

   echo $row->title;
   echo $row->name;
   echo $row->body;
}
If you want a specific row returned you can submit the row number as a digit in the first parameter:

$row = $query->row(5);
row_array()
 
 
 


Messages In This Thread
foreach need? - by El Forum - 02-08-2010, 09:22 AM
foreach need? - by El Forum - 02-08-2010, 09:25 AM
foreach need? - by El Forum - 02-08-2010, 09:31 AM
foreach need? - by El Forum - 02-08-2010, 09:39 AM
foreach need? - by El Forum - 02-08-2010, 08:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB