473,242 Members | 1,479 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

Cannot retrieve greek characters from database.

Hi, i have made a database using phpmyadmin. All encoding of the database is set to utf8_general_ci. The php code is written in UTF-8 without BOM. The problem is that despite the fact that i can insert greek characters via a login form, which appear properly inside the database tables, when i retrieve them they are displayed in the browser like this ???????. I checked some similar topics but could not figure some solution.
May 25 '10 #1
7 2650
RedSon
5,000 Expert 4TB
Does the browser have greek language support installed?
May 25 '10 #2
RedSon
5,000 Expert 4TB
Also, what software is between your database and your web browser? If you are using phpmyadmin and you can see the characters appropriately in the browser using that application but with the same browser using your application they do not appear properly I would say the issue is with your application.

We're going to need to see some source code in the areas of where you retrieve the data from the database and around where you display it to the user.
May 25 '10 #3
Here is a function i use to fill a drop down list with enum values from my database
Expand|Select|Wrap|Line Numbers
  1. function optionlist(){ 
  2.     $result=mysql_query('SHOW COLUMNS FROM mathimata WHERE field=\'examhno\'');
  3. while ($row=mysql_fetch_row($result))
  4. {
  5.     $r = $_GET['Result'];
  6.    foreach(explode("','",substr($row[1],6,-2)) as $v){
  7.    if ($v==$r)
  8.    {
  9.      print("<option selected>$v</option>");
  10.    }
  11.    else
  12.    {
  13.    print("<option>$v</option>");
  14.    }
  15.    }
  16. }  
  17. }
  18.  
May 25 '10 #4
RedSon
5,000 Expert 4TB
What is that gobbledygook? Is it PHP?
May 25 '10 #5
It is PHP, sorry for the bad syntax/programming but it's been like a month since i started with php. Also another simple PHP function i used is this
Expand|Select|Wrap|Line Numbers
  1.     $sql = "SELECT firstname FROM `login` where id=\"5\"";                                       
  2.     $result = mysql_query($sql) or die('error');  
  3.     $result = mysql_fetch_array($result); 
  4.     echo $result['firstname'];
  5.  
May 25 '10 #6
RedSon
5,000 Expert 4TB
No, I just ask because I can't read PHP, and I now have to move your thread to PHP.
May 25 '10 #7
I figured a solution i put this lines right after every connection to database

mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("SET NAMES 'utf8'");
May 25 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Kostas Koukoravas via .NET 247 | last post by:
Hi, I'm developing an application that needs to read a UML diagramfrom Visio. By iterating through the shapes collection of eachShape that represents a Class, I can retrieve the attributes ofthe...
27
by: alexdoulou | last post by:
Hello, I am trying to type greek fonts into common html forms on the Internet explorer but erroneous text is being typed instead of clear greek. Greek language pack is installed correctly....
2
by: chanmm | last post by:
Dear all, I cannot retrieve the cell value and row from table that I have added all the rows and cells in. Why???? Regards, MingMan
3
by: Thomas | last post by:
Hi All, i am getting this error once i submit my page to a payment gateway and when it returns the reponse back. Redirect URI cannot contain newline characters. Description: An unhandled...
1
by: Ryan | last post by:
Hi, I'm trying to do retrieve some data from a table where the content is in Greek, however, the query is not working. It's a very simple statement, but I'm missing something. Here is the...
0
by: cmrhema | last post by:
Hi I have added datas into a hash table as below For I = 0 To RowCount - 1 RegNo = (Ds.Tables("chktable").Rows(I)(0)) ...
2
by: Nagstor | last post by:
Hi I have been facing a problem with greek characters in the mail being generated using CDONTS they are coming up as " ???????" is there a charset definition i can set to the body... (like...
0
by: Georg | last post by:
Hello, I'm using SSIS (SQL Server Integration Services) via Native Informix OLE DB provider to extract (ETL) data from Informix 7.3 to SQL Server 2005. I have following problem, when I try...
2
by: rsam2011 | last post by:
Hi there, I have a strange problem with an application running on Windows 2000 connecting to a SQL Server 2000 with Greek collation. Runnin this query on the SQL "SELECT...
12
by: Punkis | last post by:
Hi all, I have a problem with my php and mysql project. I use an auctions software, named phpauction for my project. I import into my database with utf8 encodingm and I can see the greek...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.