Welcome Guest, Not a member yet? Register   Sign In
How to add a counter to a MySQL Table?
#4

[eluser]thePiet[/eluser]
[quote author="Mohsen32" date="1249046548"]Is this gonna work:

Code:
$data = array(
'click_count' => 'click_count + 1'
);

$this->db->select('click_count')->where('id', $row->id);
$this->db->update('ads', $data);
[/quote]

More something like:

Code:
$data = array(
'click_count' => 'click_count + 1'
);

$this->db->where('id', $some_id);
$this->db->update('ads', $data);

I guess.


Messages In This Thread
How to add a counter to a MySQL Table? - by El Forum - 07-30-2009, 11:17 PM
How to add a counter to a MySQL Table? - by El Forum - 07-31-2009, 12:38 AM
How to add a counter to a MySQL Table? - by El Forum - 07-31-2009, 02:22 AM
How to add a counter to a MySQL Table? - by El Forum - 07-31-2009, 03:28 AM
How to add a counter to a MySQL Table? - by El Forum - 07-31-2009, 03:58 AM
How to add a counter to a MySQL Table? - by El Forum - 07-31-2009, 09:48 PM
How to add a counter to a MySQL Table? - by El Forum - 09-06-2009, 08:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB