CodeIgniter Forums
concatenating values - 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: concatenating values (/showthread.php?tid=7199)



concatenating values - El Forum - 03-29-2008

[eluser]bigtime[/eluser]
how do you do concatenation in CI?

In PHP I would do

Code:
$ParaLoop = 1

printf((mysql_result($result,0,"Para".$ParaLoop))

Para1 being a database field, in php this would bring that value out how would i do this using CI?


concatenating values - El Forum - 03-29-2008

[eluser]Tom Glover[/eluser]
Just the same as normal PHP. Any more questions don't be afraid to ask.


concatenating values - El Forum - 03-29-2008

[eluser]bigtime[/eluser]
ah k thought so, but I’ve being trying to do this past hour or so with no success, I can get the echo to come out as "Para1" which is what I want but its not appending it against the active record.

I’ll solve it, I’ll be back when I’ve got a result..


concatenating values - El Forum - 03-29-2008

[eluser]bigtime[/eluser]
how do you call an Active Record from a viewer?


concatenating values - El Forum - 03-29-2008

[eluser]Tom Glover[/eluser]
Now this one im not sure about, but you would normally call the active record in the model, load the model and call the function in the controller assigning it to a var, then loading the var in the view file.

Useful Links:
* Database Class
* Active Record Class
* User Guide


concatenating values - El Forum - 03-29-2008

[eluser]bigtime[/eluser]
Quote:Now this one im not sure about, but you would normally call the active record in the model, load the model and call the function in the controller assigning it to a var, then loading the var in the view file.

yeah i've done that i'm just not sure how to append the active record to a query on the view, for now i've just done a manual select on the view and it works fine.