Skip to content
Advertisement

How to Update some records with still maintain other records in Codeignitter?

Table Info :

id-data id-note note
1 5 I went home with John Harrison
2 5 I had dinner with John Harrison
3 5 I went shopping with John Harrison
4 3 I had dinner with John Harrison

I want to updateJohn Harrison” in note where id-note (5), with “Sebastian” but still maintain the other sentence, using codeigniter-3 model-controller

Table Info after update should be :

id-data id-note note
1 5 I went home with Sebastian
2 5 I had dinner with Sebastian
3 5 I went shopping with Sebastian
4 3 I had dinner with John Harrison

All suggestions will be very helpful.

Advertisement

Answer

I made an example for you that I think works for you.

you need to find and use str_replace for change your note. see example:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement