CodeIgniter Forums
typos in active_record.html ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: typos in active_record.html ? (/showthread.php?tid=6403)



typos in active_record.html ? - El Forum - 02-25-2008

[eluser]Unknown[/eluser]
On user_guide/database/active_record.html it reads

1)

$this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE);

should probably read

$this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4) AS amount_paid', FALSE);


2)
$array = array('title' => $match, 'page1' => $match, 'page2' => $match);

$this->db->like($array);

// WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'

Most probably, it should read

$array = array('title' => $match1, 'page1' => $match2, 'page2' => $match3);

$this->db->like($array);

// WHERE title LIKE '%$match1%' AND page1 LIKE '%$match2%' AND page2 LIKE '%$match3%'