CodeIgniter Forums
Bookmarks - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Bookmarks (/showthread.php?tid=5224)



Bookmarks - El Forum - 01-12-2008

[eluser]Sawariya[/eluser]
Hi friends ,,

How to update number of bookmarks in our table..

anybody have idea ... plz help me


Bookmarks - El Forum - 01-12-2008

[eluser]Nagabhushana[/eluser]
hi, please tell me how to count the book marking


Bookmarks - El Forum - 01-14-2008

[eluser]eggshape[/eluser]
Hi - Your request is a little ambiguous for me, but maybe this will help; this assumes your database field is called 'bookmarks':

@Sawariya: (btw, is that aishwarya rai?)
Code:
$sql = "UPDATE table_name SET bookmarks = ?";
$query = $this->db->query($sql, array($number)); //will update bookmarks with $number, set table_name to whatever name your table is

@Nagabhushana:
Code:
$sql = "SELECT COUNT(bookmarks) AS total FROM table_name"; // 'AS total' is an alias for the total number of bookmarks
$query = $this->db->get($sql);
$row = $query->row();
$total = $row->total;

In SQL statements, it's customary to UPPERCASE SQL syntax but it's not necessary.


Bookmarks - El Forum - 01-22-2008

[eluser]Sawariya[/eluser]
thanks friends...
this way i know.. i want to updates number of bookmarks after
bookmarked a particular link.. how can its possible... Anybody can help me to do..

thanks again. for your reply