We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Query module and UTF8

Development and Programming

quaimaker's avatar
quaimaker
8 posts
8 years ago
quaimaker's avatar quaimaker

Hi,

I’m confused. I used so far in a very old template (from Expression Engine 1.7.x) the query module and it was working well with this version.

The same query in a template with EE 3.5.2 cannot handle the german umlauts. If I do instead work directly with PHP, the results are correct.

I don’t see any settings to configure the character set of the EE query.

=== the query part ===

{exp:query sql="SELECT OT FROM qa WHERE ID = '{segment_3}'"}
<h1>Details zu »{OT}«</h1>
{/exp:query}

… and the result is:

Details zu »Maigret und der hartnäckigste Gast der Welt«

=== the php part ===

<?php

if (ctype_digit({segment_3}))
{ 
 $sql_q = "SELECT OT FROM qa WHERE ID = '{segment_3}'";

 $pdo= new PDO('mysql:host=localhost;dbname=xx', $username, $db_pw);

 $sql = $pdo->prepare($sql_q);
 $sql->execute();
  
 while($ae = $sql->fetch())
  {
   echo '<h1>Details zu »' . $ae['OT'] . '«</h1>';
  }
}
?>

and the result is:

Details zu »Maigret und der hartnäckigste Gast der Welt«

What could be wrong?

Regards Oliver

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.