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

  • SEARCH
  • Home
  • 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 1015379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:23:34+00:00 2026-05-16T10:23:34+00:00

When i return a row from my mySQL database, I get a ? instead

  • 0

When i return a row from my mySQL database, I get a ? instead of some characters eg:ò, à
etc. My mysql row and table are set to utf8_unicode_ci, so I think the database is storing it correctly but php isnt returning it correctly.

Think it has something to do with mysql_set_charset but cant get it to work properly. Any help would be greatly appreciated!!

  <?php 
if($row = mysql_fetch_assoc(queryDb("SELECT * FROM customer WHERE uuid='".$_COOKIE['uuid']."'")))
 {
  $first_name = $row['first_name'];
  $last_name = $row['last_name'];
  $gender = $row['gender'];


  $ileach_first_name = $row['ileach_first'];
  $ileach_last_name = $row['ileach_last'];

}

 //If Ileach Name is blank

  if($ileach_last_name == "" || $ileach_first_name == ""){


  // Get ileach last name
  $row = mysql_fetch_assoc(queryDb("SELECT * FROM ileach_last_names WHERE eng_name='$last_name'"));

  $ileach_last_name = $row['gae_name']; 


  if($ileach_last_name == "") {
     $row = mysql_fetch_assoc(queryDb("SELECT * FROM ileach_last_names order by rand() limit 1"));
    $ileach_last_name = $row['gae_name'];}  



  //Get ileach First Name
   //If Male
    if($gender == 'M') {

     $row = mysql_fetch_assoc(queryDb("SELECT * FROM ileach_first_names_m WHERE eng_name='$first_name'"));

     $ileach_first_name = $row['gae_name']; 

     //If no name is selected, get one randomly 
      if($ileach_first_name == "") {
       $row = mysql_fetch_assoc(queryDb("SELECT * FROM ileach_first_names_m order by rand() limit 1"));
     $ileach_first_name = $row['gae_name']; }
    }
   //If Female 


    else{

     $row = mysql_fetch_assoc(queryDb("SELECT * FROM ileach_first_names_f WHERE eng_name='$first_name'"));

     $ileach_first_name = $row['gae_name']; 

     //If no name is selected, get one randomly 
     if($ileach_first_name == "") {
       $row = mysql_fetch_assoc(queryDb("SELECT * FROM ileach_first_names_f order by rand() limit 1"));
     $ileach_first_name = $row['gae_name'];}
    }




  //Save ileach name into db

   mysql_query("UPDATE customer SET ileach_first = '$ileach_first_name'
   WHERE uuid='".$_COOKIE['uuid']."' ");

   mysql_query("UPDATE customer SET ileach_last = '$ileach_last_name'
   WHERE uuid='".$_COOKIE['uuid']."' ");
  }


  //Stitch name together.

  $full_ileach_name .=$ileach_first_name;
  $full_ileach_name .= " ";
  $full_ileach_name .= $ileach_last_name;





?>
  • 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-16T10:23:34+00:00Added an answer on May 16, 2026 at 10:23 am

    “Think it has something to do with mysql_set_charset” – yes, very likely.

    $mysql = mysql_connect(...); // TODO: error handling
    mysql_select_db('...', $mysql);  // TODO: error handling
    mysql_set_charset('utf8', $mysql);  // TODO: error handling
    

    For mor detailed information we need to know more about the function queryDB() and related stuff (like e.g. where the database connection is established)

    see also:

    • http://dev.mysql.com/doc/mysql/en/charset-connection.html
    • http://docs.php.net/mysql_set_charset
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to return a result set from a MySQL database table of
Is there a way to return a random row from a table using LINQToSQL?
Left outer joins should return at least one row from the T1 table if
I have a PHP server script that SELECTs some data from a MySQL database.
I have the following mysql table schema: SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; -- -- Database: `network` --
How can I get data from a UTF-8-encoded MySQL database without getting the UnicodeDecodeError?
I have a php page that pulls data from a mysql database based on
I need to return only 1 row per specific database entry. For e.g. if
I dont get an error but it does not return me the row values
I have defined a web service that will return the data from my mysql

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.