473,396 Members | 1,971 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,396 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 2660
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.