Ahmad Naser Turnkey Ecosystem Ahmad Naser
August 27, 2020

Support Arabic in mysqli php query

Published in the Ahmad Naser ecosystem. Estimated reading time: 1 minute.

include("connection.php");
$query = "SELECT * FROM problemstable WHERE ptype = 'معلمين';";
// Change character set to utf8
$conn->set_charset("utf8");


// Check connection
if (mysqli_connect_errno()) {echo "Failed to connect to MySQL: " . mysqli_connect_error();}

$results = mysqli_query($conn, $query);



if($results){
   
}else{
    echo "no data: ";
  exit();  
}



while( $row = mysqli_fetch_array($results)){


$row['pname']

}

Leave a Reply

Your email address will not be published. Required fields are marked *