Welcome Guest, Not a member yet? Register   Sign In
concatenating values
#1

[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?
#2

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

[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..
#4

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

[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
#6

[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.




Theme © iAndrew 2016 - Forum software by © MyBB