johnsmith180
Programmer
Hi
I wonder if you could help me with this problem.
I want to store and search Arabic text in MySQL database. I am running MySQL 4.1. and the collation is set to "cp1256_general_ci" for database, tabel and column.
Now, in PhpMyAdmin, if I run the following sql, it works:
SELECT * FROM Arabic where t1='????'
However, I am also running this SQL in a PHP file, like:
<?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 t1='????'") or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo $row['t1'];
echo "<br />";
echo $row['t2'];
echo "<br />";
}
?>
However, when I try to run the above sql from a php file, I get the following error:
Illegal mix of collations (cp1256_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
How can I solve this problem.
Thanks
I wonder if you could help me with this problem.
I want to store and search Arabic text in MySQL database. I am running MySQL 4.1. and the collation is set to "cp1256_general_ci" for database, tabel and column.
Now, in PhpMyAdmin, if I run the following sql, it works:
SELECT * FROM Arabic where t1='????'
However, I am also running this SQL in a PHP file, like:
<?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 t1='????'") or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo $row['t1'];
echo "<br />";
echo $row['t2'];
echo "<br />";
}
?>
However, when I try to run the above sql from a php file, I get the following error:
Illegal mix of collations (cp1256_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
How can I solve this problem.
Thanks