Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7629699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:54:10+00:00 2026-05-31T05:54:10+00:00

In MySQL I have a string, which is displayed properly in phpmyadmin, with the

  • 0

In MySQL I have a string, which is displayed properly in phpmyadmin, with the collation set to utf8_general_ci .

In the PHP file, I have set the header using plain HTML:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

The php files are hosted on Ubuntu, Apache 2.2, and the files are saved in UTF-8 without BOM (using Notepad++)

I have set the connection to use utf8:

@mysql_query("set names 'utf8'", $this->link);
$r = @mysql_query($query, $this->link);

it returns the string ( varchar 255 ) and using PHP echo , it is displayed to the browser.

However, I am still getting ????? instead of the actual words.

I can’t seem to be able to searched for what I might have missed, your help is much appreciated.

===== Edit =====

Database, table and column can have three different collations, I have set them all to utf8_general_ci , and calling mysql_set_charset(‘utf8’) immediately after the connection is made, have solved my problem.

I hope this will act as a useful checklist for future people bumping into the same problem. I for one may very well return in a few months to check if I have missed anything 🙂

Thanks all for the great input.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:54:11+00:00Added an answer on May 31, 2026 at 5:54 am

    Be sure your table is in utf8_general_ci.
    Database and tables can have a different charset
    (can happen when you change it by yourself).

    And be careful with some functions, like htmlentities,
    which have a default charset parameter set to ISO-8859-1 for PHP <5.4.0
    (set to UTF-8 for PHP >5.4.0)

    http://php.net/manual/en/function.htmlentities.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an AJAX request (using JQuery) that calls a PHP script which does
I have a webserver running mysql and php which sends data to a json
I have a malformed string which may be caused by a bug of MySQL
I have a PHP MySQL database which I will be storing all my information
I have mysql table that has a column that stores xml as a string.
I have a task of parsing a simple XML-formatted string in a MySQL stored
I have 3 tables in my DB (MySQL). categories (name:string) items (name:string, category_id:int) votes
I want to store data in string form to MySQL. I have created the
I have mysql database and I want a software which can draw the database
I have to store hindi text in a MySQL database, fetch it using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.