I have a select statement that should select all the data in the database equal to Arabic input, I have exactly set the database mapping to utf8_general_ci and the table column. And in the file
$conn = mysqli_connect($mysql_host, $mysql_user, $mysql_password, $mysql_database);
mysqli_query($conn, "set names 'utf8'");
mysqli_query($conn, "SET character_set_results=utf8");
mb_http_output('UTF-8');
mb_internal_encoding('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');
mb_language('uni');
mb_internal_encoding('UTF-8');
mysqli_set_charset($conn, "utf8");
And the search code
$question = $_REQUEST['question'];
$table = $_REQUEST['subject'];
if(empty($question)) {
echo "Type a question!"; }
$qe = mysqli_escape_string($conn, $question);
$full = "SELECT * FROM $table WHERE question LIKE '%$qe%'";
$fullQ = mysqli_query($conn, $full);
if(!$fullQ) {
echo mysqli_error($conn);
}
echo "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>";
printf(nl2br("\n%u\n"), mysqli_num_rows($fullQ));
while($row = mysqli_fetch_assoc($fullQ)) {
printf(nl2br("\n%s\n"), $row['question']);
}
It works if I print all the data without using WHERE, and also prints the SQL syntax after it is sent from the first page to the second from the right with the correct Arabic characters. But it always returns 0 rows.
Nezoo source
share