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 8007449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:49:42+00:00 2026-06-04T17:49:42+00:00

Now I got a database. The database is encoded with the almighty utf-8 collation.

  • 0

Now I got a database. The database is encoded with the almighty utf-8 collation. Actually collation is utf8, I am not sure what the encoding is. That should be another question.

Then I made a program to retrieve data from the database.

<?php
    require_once('convertArraytoJson.php');
    require_once('config.php');
    mysql_connect ( "localhost", $databaseuser, $databasepassword);
    mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'");
    @mysql_select_db ($databasename) or die ( "Unable to select database" );
    $data=$_GET['id'];
    $query="SELECT * FROM `tabletes` where id = '".$data."'";
    $data = mysql_query($query);
    while (true){
        $info = mysql_fetch_array ( $data, MYSQL_ASSOC );
        if ($info == false) {
            break;
        }
        //$output[]=$info;
        $output[$info['ID']]=$info;
        unset ($output[$info['ID']]['ID']);
    }
    $result = array2json($output);

    echo $result;
?>

The content of the database looks like this:

enter image description here

Now I call the function by doing this (you need to enlarge your screen to see it):

http://localhost/domainname/api/test2.php?id=jr-東北本線-荒川橋梁__35.79_139.72

It doesn’t work.

However, if I do NOT use $_GET but simply enter the Japanese characters directly in the code it works.

So if I change:

$data = $_GET['id']

to

$data = 'jr-東北本線-荒川橋梁__35.79_139.72'

Things are working fine.

Of course, I don’t want to hardwire the ID, I want to access that via $_GET[‘id’]. What should I do?

  • 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-06-04T17:49:44+00:00Added an answer on June 4, 2026 at 5:49 pm

    Just use urlencode() – your string becomes like:

    %E6%9D%B1%E5%8C%97%E6%9C%AC%E7%B7%9A-%E8%8D%92%E5%B7%9D%E6%A9%8B%E6%A2%81.

    These Chinese characters are not allowed.

    Check rfc1738: Uniform Resource Locators (URL)

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

Sidebar

Related Questions

I've got a MySQL database that stores image information. Right now it only has
We've got a database that was imported from another domain and when importing the
I have a simple problem with XML got from database. Now, this XML can
i have done some learning on struts based on one project that i got.Now
We integrated a wysiwyg editor in our website. Now we got the problem that
Right now we've got a hard-coded set of characters that we check for --
I got indexed a Mysql database using Solr and everything is perfect. Now i
I've got a database table that stores images as varbinary(max). This works great for
I actually working on a website-project. Behind my website, I´ve got a database with
I've got a database created using Django models which I'm now accessing using SQLAlchemy

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.