1

it does not compute when I use the letter æ I have tried with Collation latin1_Swedish_Ci and latin1_Danish_Ci which are the only two that I have found to work with æ ø å

$sql="SELECT MIN(PrisMel) FROM `toosttable` WHERE `Vare` = 'Lærer'";
$result=mysqli_query($con,$sql);

The fetched value is a number.

Dipz
  • 15
  • 4

3 Answers3

0

To get these characters printed you can maybe use utf8_encode("YOUR SQL-QUERY STRING") .

That should convert your string into an utf8-encoded one and give it to your mysqli_query() function.

Ian
  • 147
  • 1
  • 13
0

Can you try to give the query like this.

select column_name from table_name where column_name like '%[^a-z, .-™]%';
Alan Pallath
  • 99
  • 3
  • 14
0

I found a solution to my problem. Simply set the charset with this mysqli_set_charset($con, "utf8"); Here is the full code to be exact:

$con=mysqli_connect('localhost','root','','toostdatabase');
                                // Check connection
                                if (mysqli_connect_errno())
                                {
                                  echo "Failed to connect to MySQL: " . mysqli_connect_error();
                                }
                                mysqli_set_charset($con, "utf8");

$sql = "SELECT MIN(PrisMel) FROM `toosttable` WHERE `Vare` = 'Lærer'";
$result = mysqli_query($con,$sql);
Dipz
  • 15
  • 4