Hi again, I have a simple html form that submits information with POST function. But when information contains a Cyrillic characters, in table in MySql there becomes азазаза symbols instead of text. The table is on utf-8_general_ci, the site is on UTF-8 encoding. I visualize the result from this table with
$query = "
SELECT ".$db->nameQuote('ingredients')."
FROM ".$db->nameQuote('other')."
ORDER by id DESC
";
$db->setQuery($query);
$ingredients = $db->loadResult();
I cant understand how to tell the form to send chyrillic characters correct. Or where is the problem at all? How to fetch this characters correctly? Or how to send them correctly?
-----------------EDIT-----------------------
I couldn't understand where to put
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");
So I'm pasting my code here. First the simple form:
<form action="insert.php" method="post" onsubmit="return checkForm(this)" target="_top">
<table>
<tr>
<td colspan="2">
<ul>
<li> Добавете необходимите за рецептата съставки</li>
<li> Моля попълнете всички полета коректно</li>
<li> Полетата маркирани с (*) са задължителни</li>
</ul>
</td>
</tr>
<tr>
<td>
Количество (порции)*:
</td>
<td>
<input type="text" name="quantity" />
</td>
</tr>
<tr>
<td>
Съставки*:
</td>
<td>
<input type="text" name="ingredients" />
</td>
</tr>
<tr>
<td>
Време за приготвяне*:
</td>
<td>
<input type="text" name="timing" /><br />
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Напред" class="button validate" />
</td>
</tr>
</table>
</form>
And the fetching syntax inside my insert.php file:
$query = "
SELECT ".$db->nameQuote('quantity')."
FROM ".$db->nameQuote('other')."
ORDER by id DESC
";
$db->setQuery($query);
$quantity = $db->loadResult();
$query = "
SELECT ".$db->nameQuote('ingredients')."
FROM ".$db->nameQuote('other')."
ORDER by id DESC
";
$db->setQuery($query);
$ingredients = $db->loadResult();
$query = "
SELECT ".$db->nameQuote('timing')."
FROM ".$db->nameQuote('other')."
ORDER by id DESC
";
$db->setQuery($query);
$timing = $db->loadResult();