I have this code:
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
mysqli_set_charset($conn,'latin1_swedish_ci');
echo mysqli_character_set_name($conn);
$sql = "SELECT * FROM ggg";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "keyword: " . $row["keyword"]. " - Name: " . $row["firstname"]. " " . $row["lastname"] . $row["info"] . "<br>";
}
} else {
echo "0 results";
}
The $row["info"]-parts in the echoed result are full of questionmarks inside a rectangle instead of the swedish signs "å, ä, ö". Although the charset is correctly set to "latin1_swedish_ci" which is exactly the same as in the database (which I checked from phpMyAdmin).
What to try next, anyone have any ideas?