Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End HAVING or WHERE on json value for persian word?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #34838
    binboy
    Participant

    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)(i use codeigniter)

    row_s is as:

    row_s id 1: [“All5″,”u0648u06ccu0632u0627 8”]
    row_s id 2: [“All5″,”u0648u06ccu0632u0627 7”]
    row_s id 3: [“All5″,”u0648u06ccu0632u0627 6”]

    This is my php code:(output this is: There is not)

    $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 . '
    ';
    }
    } else {
    echo 'There is not';
    }

    Can where value “$val” that is number or latin word with value json in database, but can not for persian word.

    for example, following code have output, and is $query->num_rows()=3.


    $val = 'All5';
    $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 . '
    ';
    }
    } else {
    echo 'There is not';
    }
    #89354
    ic3d
    Member

    Are all your headers and textarea’s also UTF-8?

    #89375
    binboy
    Participant

    Yes, they are UTF-8.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.