php script for geting form data in mysql db and displaying data on the page doesnt work in cyrillic
<p>Again problem with script when i use cyrillic letters. I have simple php script witch gathers data from form, sets that in mysql db, and displays that data on the web page. The script is the simpliest as it can be. Im new in php programming so i watch many tuts, so to set story short, its simple script. It works ok when i use latin letters. BUT. When i use the same script (which obviously works) for inputs in cyrillic letters it shows error on "mysql_fetch_error"!? I red many coments about similar problem on internet, and theres no simple answer. Collation is ok, i tried with utf8-unicode, utf8-general and utf8-bin, again nothing.</p>

<pre><code> &lt;?php
 if(isset($_POST['submit'])){
$con=mysql_connect('x','x','x');
    if(!$con){
    die("Cant connect:".mysql_error());
 }
 mysql_query('SET NAMES "UTF8"');

 mysql_select_db("x",$con);
 $ins = sprintf('INSERT INTO x  (`Име_и_презиме`,`Датум_рођења`,`Занимање`,`Град`,`Земља`,`Имејл`,`Скајп`) VALUES 
("%s", "%s", "%s", "%s", "%s", "%s", "%s")', 
mysql_real_escape_string($_POST['ime']),
mysql_real_escape_string($_POST['datum']),
mysql_real_escape_string($_POST['zanimanje']),
mysql_real_escape_string($_POST['grad']),
mysql_real_escape_string($_POST['zemlja']),
mysql_real_escape_string($_POST['email']),
mysql_real_escape_string($_POST['skype'])
);
mysql_query($ins,$con);
mysql_close($con);
}
?&gt;

&lt;?php
$con=mysql_connect('x','x','x');
if (!$con){
die("Cant connect:" . mysql_error());
}
mysql_query('SET NAMES "UTF8"');

mysql_select_db ("x",$con);
$sql="SELECT * FROM x"; 
$myData=mysql_query($sql,$con);
echo "&lt;table border=1&gt;
&lt;tr&gt;
&lt;td&gt;Име и презиме&lt;/td&gt;
&lt;td&gt;Датум рођења&lt;/td&gt;
&lt;td&gt;Занимање&lt;/td&gt;
&lt;td&gt;Град&lt;/td&gt;
&lt;td&gt;Земља&lt;/td&gt;
&lt;td&gt;Email&lt;/td&gt;
&lt;td&gt;Skype&lt;/td&gt;
 &lt;/tr&gt;";
 while($record=mysql_fetch_assoc($myData)){
 echo "&lt;tr&gt;";
 echo "&lt;td&gt;" . htmlspecialchars($record['Име_и_презиме']) . "&lt;/td&gt;";
 echo "&lt;td&gt;" . htmlspecialchars($record['Датум_рођења']) . "&lt;/td&gt;";
 echo "&lt;td&gt;" . htmlspecialchars($record['Занимање']) . "&lt;/td&gt;";
 echo "&lt;td&gt;" . htmlspecialchars($record['Град']) . "&lt;/td&gt;";
 echo "&lt;td&gt;" . htmlspecialchars($record['Земља']) . "&lt;/td&gt;";
 echo "&lt;td&gt;" . htmlspecialchars($record['Имејл']) . "&lt;/td&gt;";
 echo "&lt;td&gt;" . htmlspecialchars($record['Скајп']) . "&lt;/td&gt;";

 echo "&lt;/tr&gt;";}
 echo "&lt;/table&gt;";   

 mysql_close($con);  
 ?&gt;
</code></pre>

<p>ERROR:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/xyz/public_html/form.php on line 46</p>
