![]() |
how ican converte stdClass Object to string - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: how ican converte stdClass Object to string (/showthread.php?tid=28809) |
how ican converte stdClass Object to string - El Forum - 03-22-2010 [eluser]kosaidpo[/eluser] hello everyone i guess all in the title well this how i proceed when i do this kind of sql query Code: SELECT id_forum ,nom_forum ,descri_forum , and i use the html class table it gives me a message sayin could not convert std class object to string i ve looked around the Doc but icudnt find anythin i can do with this class to convert it tnx for replies in advance : ) how ican converte stdClass Object to string - El Forum - 03-22-2010 [eluser]kosaidpo[/eluser] okay i 've found it i shud return the query as an array usin result_array() if anyone knows sumthin better post it please kosaidpo how ican converte stdClass Object to string - El Forum - 03-22-2010 [eluser]danmontgomery[/eluser] There is a way to "convert" stdClass to a string (the __toString method), but that's not what you need here. The problem is that you're passing a function an object ( I'm guessing you're directly passing $query->result() ), when the function is expecting a string. how ican converte stdClass Object to string - El Forum - 03-22-2010 [eluser]kosaidpo[/eluser] i really dont get you im new to CI but here's wht i did in model Code: $Q=query bla bla here ; Code: $res['r']=callin the model_methode |