Forum Moderators: coopster

Message Too Old, No Replies

no results back with umlaut in query

         

jdeaap

6:18 pm on Feb 25, 2009 (gmt 0)

10+ Year Member



Intro:
I have a mysql database with collition utf-8.
When i start on my mysql the following query $query1 = "SELECT Count(Biernaam) AS One FROM Bierlijst WHERE (Biertype = 'Kölsch') and (Stemmen > 9)"; then i get 3 rows. This is ok.

So i made een .php script for my website en past the same query in it

$query1 = "SELECT Count(Biernaam) AS One FROM Bierlijst WHERE (Biertype = 'Tripel') and (Stemmen > 9)";
$result1 = mysql_query($query1)
or die("Fout bij uitvoeren query");
While ($row = mysql_fetch_assoc($result)){
echo $row[Biernaam];
}

To make connection to the database is no problem, but we i start the query then i got no results back and it had to be 3 rows.

What can be the problem

henry0

10:32 pm on Feb 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jdeaap, welcome to WebmasterWorld!

You are declaring result1 and using result :)
you should have
<<<<
$result1 = mysql_query($query1)
or die("Fout bij uitvoeren query");
While ($row = mysql_fetch_assoc($result1)){
>>>>>

jdeaap

2:52 pm on Feb 26, 2009 (gmt 0)

10+ Year Member



I made a type mistake in it had to be

$query1 = "SELECT Count(Biernaam) AS One FROM Bierlijst WHERE (Biertype = 'Tripel') and (Stemmen > 9)";

$result1 = mysql_query($query1)
or die("Fout bij uitvoeren query");

While ($row = mysql_fetch_assoc($result1)){
echo $row[Biernaam];
}

So i have still the problem.