Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql query regexp with russian characters works on console but not in php
    primarykey
    data
    text
    <p>i have the following mysql query:</p> <pre><code>SELECT user_boothid,user_id,user_fname,user_lname,user_ts,user_company,user_photo FROM se_users WHERE (user_email REGEXP 'Елена' || user_displayname REGEXP 'Елена' || user_company REGEXP 'Елена' || user_title REGEXP 'Елена' || user_fname REGEXP 'Елена' || user_lname REGEXP 'Елена') &amp;&amp; user_eventid='15' &amp;&amp; user_id!='799' &amp;&amp; user_active='true' &amp;&amp; ( user_id!=818 ) </code></pre> <p>if i run this query on the console, i get the result but if i run it from the php script, don't return anything. i'm using a class to manage the DB connection and query's and is this:</p> <pre><code>function __construct($serverdb,$usernamedb,$passworddb,$namedb){ //Fixed problem when old connection (from SocialEngine) was used //$this-&gt;linkDB=mysql_connect($serverdb,$usernamedb,$passworddb)or die("Can't Connect to DB"); $this-&gt;linkDB=mysql_connect($serverdb,$usernamedb,$passworddb,TRUE)or die("Can't Connect to DB"); mysql_query("SET character_set_results=utf8", $this-&gt;linkDB); mb_language('uni'); mb_internal_encoding('UTF-8'); mysql_select_db($namedb,$this-&gt;linkDB)or die("Can't Select DB"); //mysql_query("set names 'utf8'",$this-&gt;linkDB); mysql_set_charset('utf8',$this-&gt;linkDB); } function makeQuery($query){ mysql_query("SET character_set_client=utf8", $this-&gt;linkDB); mysql_query("SET character_set_connection=utf8", $this-&gt;linkDB); //mysql_query("set names 'utf8'",$this-&gt;linkDB); mysql_set_charset('utf8',$this-&gt;linkDB); mysql_query($query,$this-&gt;linkDB)or die(mysql_error()."Query: ".$query); return mysql_insert_id($this-&gt;linkDB); } function returnQuery($query){ mysql_query("SET character_set_results=utf8", $this-&gt;linkDB); //mysql_query("set names 'utf8'",$this-&gt;linkDB); mysql_query("SET CHARACTER SET 'utf8'",$this-&gt;linkDB); mysql_set_charset('utf8',$this-&gt;linkDB); $temp=mysql_query($query,$this-&gt;linkDB)or die(mysql_error()); $num=mysql_num_rows($temp); $rows=Array(); for($i=0;$i&lt;$num;$i++){ $rows[$i]=mysql_fetch_assoc($temp)or die(mysql_error()); } return $rows; } </code></pre> <p>i tested it and the encoding seems to be ok (if i make a query with the ID, return the row with all the Russian chars as it should) but using the regexp doesn't work.</p> <p>anyone can give me a hint of where to look?</p> <p>Regards, Shadow.</p> <p><strong>UPDATE:</strong> this problem happen if i use LIKE or = to search also. <strong>UPDATE2:</strong> i realized that the problem is the $term var that contain the term to search, if i hardcode the value the query works, but no if i receive the value from post</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload