I have a simple search using PHP and MySQL
it works perfectly for English text, but for Arabic text it will not retrieve any data without any Error
while executing the same MySQL query on Database "PhpMyAdmin" works perfectly
Result.PHP
<?php
if(!isset($_POST["search"])){$_POST["search"]="";}
echo $search=$_POST["search"];
$servername = "localhost";
$username = "aramtryf_laravel";
$password = "Reha@2015";
$dbname = "aramtryf_laravel";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sSQL= 'SET CHARACTER SET utf8';
mysqli_query($conn,$sSQL);
$sql = " SELECT * FROM oldorgs WHERE org_name like '%$search%' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr>
<th scope='row'>".$row["org_name"]."</th>
<td>".$row["gov"]."</td>
<td>".$row["sector"]."</td>
<td>".$row["email"]."</td>
</tr>";
}
}
$conn->close();
?>