I have a very large MySql table: over 900 rows of different sentences. I would like to put <?php echo $this->session->userdata('firstname')?> in some of my rows. For example in:
Continue tes efforts <?php echo $this->session->userdata('firstname')?> et imagine si tes travaux étaient toujours bien faits!`
And in my view, when I do echo $data['sentence'] I would like to get
Continue tes efforts ***ROGER*** et imagine si tes travaux étaient toujours bien faits!
I need to split the sentence in my database ( id , part1 , part 2 ) (I need to “cut” my sentence in my database row when I need to get FIRSTNAME) and here is what I do:
echo $data['part1'];
echo $this->session->userdata('firstname');
echo $data['part2'];
So, I would like to know if is it possible to put some PHP inside a MySql table and read it from a echo.
you should use printf or sprintf for such things: