Welcome Guest, Not a member yet? Register   Sign In
Random Quote
#8

[eluser]Hitesh Chavda[/eluser]
To do this you must have id on each row of quote table

you can first catch the quotes table's total row
i.e. $total_row = $this->db->count_all('table_name')

then,

$random_row_no = random(1,$total_row);
$this->db->select('quote_text');
$this->db->where('quote_id',$random_row_no);
$q = $this->db->get('table_quote');

etc...


Messages In This Thread
Random Quote - by El Forum - 09-04-2009, 10:37 AM
Random Quote - by El Forum - 09-04-2009, 10:50 AM
Random Quote - by El Forum - 09-04-2009, 11:06 AM
Random Quote - by El Forum - 09-04-2009, 12:15 PM
Random Quote - by El Forum - 09-04-2009, 01:27 PM
Random Quote - by El Forum - 09-04-2009, 01:51 PM
Random Quote - by El Forum - 09-04-2009, 08:00 PM
Random Quote - by El Forum - 09-05-2009, 04:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB