php - Update clause in codeigniter -
I am Giovanni, and I'm a new programmer on Codeigner.
Here I want to ask about the Update Clause in CodeIgniter, the results of my code are unaffected by the database, can you correct your code?
Here my code is on my model: news_model.php
function automatic updates ($ id) {$ this- & gt; Db- & gt; Set ('seen', 'seen' +1 ', wrong); $ This- & gt; Db- & gt; Where ('id', $ id); $ This- & gt; Db- & gt; Update ('news'); }
and on my controllers: news.php
$ this-> News_model- & gt; Autopets ($ -> -; -; section (4));
and link to my thoughts: news_view.php
When I try to fill the value of the 'id' with an ID, the code works, but when I use it variable ($ id) it's default If I change it returns an empty value, so I can not update a field.
Can you tell me where is my fault?
Thanks
Change your function call statement
< Code> $ this- & gt; News_model- & gt; Autopets ($ -> -> -> After looking at my code I found the following chagnes: 1 in your autoupdates function call 2 Update your model code and set News
News
Controller Description ()
; $ this-> db- & gt; set (see ' , 'Viewed +1')
line.
Comments
Post a Comment