Answer the question
In order to leave comments, you need to log in
The appearance of strange characters when connecting to the database, what could be the reason for this?
<html>
<head>
<title>
Работа с базой данных
</title>
</head>
<body>
<?php
include('db.php');
$query= mysql_query("SELECT * FROM articles");
$row= mysql_fetch_array($query);
echo $row['title'];
?>
</body>
</html>
<?php
$host="localhost";
$user="root";
$paswword="";
$db="new_db";
$connection= mysql_connect($host,$user,$password);
mysql_set_charset("utf8",$connection);
if(!$connection)
{
exit(mysql_error());
}
if(!mysql_select_db($db,$connection))
{
exit(mysql_error);
}
?>
Answer the question
In order to leave comments, you need to log in
1) stackoverflow.com/questions/12859942/why-shouldnt-...
2) Check db encoding
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question