johnsmith180
Programmer
Hi
Currently, I am testing how to create an Arabic website with PHP and MySQL 4.1
I have set the collation of the database , table and column to "cp1256_general_ci"
Now I have this PHP code:
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ArabicTest", $con);
$result = mysql_query("SELECT * FROM Arabic where BINARY t1='????'") or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo $row['t1'];
echo "<br />";
}
?>
However, I am getting following text: "????". Please advise me how I can display the arabic text on the web page.
(If I run "SELECT * FROM Arabic where t1='????' " in phpmyAdmin, I can get the arabic text.)
Kind regards
Currently, I am testing how to create an Arabic website with PHP and MySQL 4.1
I have set the collation of the database , table and column to "cp1256_general_ci"
Now I have this PHP code:
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ArabicTest", $con);
$result = mysql_query("SELECT * FROM Arabic where BINARY t1='????'") or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo $row['t1'];
echo "<br />";
}
?>
However, I am getting following text: "????". Please advise me how I can display the arabic text on the web page.
(If I run "SELECT * FROM Arabic where t1='????' " in phpmyAdmin, I can get the arabic text.)
Kind regards