Welcome Guest, Not a member yet? Register   Sign In
Object of class stdClass could not be converted to string
#4

[eluser]Cristian Gilè[/eluser]
Code:
<?php
foreach($query as $value)
{
      echo $value->id;
      echo $value->title;
      echo $value->content;
      echo $value->date;
}
?>
If $query returns a single result row and not an array of objects, you can avoid the foreach. Read the user guide.


Cristian Gilè


Messages In This Thread
Object of class stdClass could not be converted to string - by El Forum - 01-29-2011, 04:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB