CodeIgniter Forums
HAVING or WHERE on json value for persian word? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: HAVING or WHERE on json value for persian word? (/showthread.php?tid=46150)



HAVING or WHERE on json value for persian word? - El Forum - 10-20-2011

[eluser]SaSa[/eluser]
I want done "HAVING" for value json that store values array in a row from database table with json_encode, this values is persian word but but not done "HAVING" for it, how is fix it?(collation is utf8_general_ci)

row_s is as:

Quote:row_s id 1: ["All5","\u0648\u06cc\u0632\u0627 8"]
row_s id 2: ["All5","\u0648\u06cc\u0632\u0627 7"]
row_s id 3: ["All5","\u0648\u06cc\u0632\u0627 6"]

This is my php codeSadoutput this is: There is not)

Code:
$val   = 'ویزا 8';
$query = $this->db->query('SELECT * FROM table HAVING row_s LIKE "%' . $val . '%"');
if ($query->num_rows() > 0) {
    foreach ($query->result() as $val) {
        echo $val->name . '<br>';
    }
} else {
    echo 'There is not';
}