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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:07:27+00:00 2026-06-08T15:07:27+00:00

I have been trying to find a solution for past few hours but unable

  • 0

I have been trying to find a solution for past few hours but unable to do so. I have tried each and every possible solution on the Internet and this forum but nothing seems to be working. Here is the problem .

I want to store arabic data that user will type or paste in the textarea of form in mysql database. The website is arabic and form only contains this one textarea.

Important Points:

The website is displaying static arabic content correctly. utf8 charset is used throughout the website. So it is not a problem.

The table (home ) and the content field(content) are both set to utf8_unicode_ci collation so it is not a problem either.

Form is set to accept-charset=’utf-8′ so that’s not a problem either.

When I insert arabic text using phpMyAdmin in the table I don’t have any problem at all with it.

In fact when arabic text (entered through phpMyAdmin) in the table is retrieved on the website it shows perfectly.

But as soon as arabic data is entered in text area and sent to DB to be stored using insert query data transforms into ????

I am using

mysql_query("SET NAMES 'utf8'"); 
mysql_query('SET CHARACTER SET utf8');

After Connection so it is not a problem at all. As I said earlier the data is retrieved all right. I have uploaded the two images. Demonstrating my problem.

I am really stuck here and as you can see I have taken all the steps possible to solve this as well but this behavior is really weird. Please help.

Image 1: Showing data is retrieved from same table properly which was stored directly thru phpMyadmin

Image 2 Showing the same data when sent to mysql databse into same table turns into ???

The code I am using to insert the data into db is:

 $content=$_POST["content"];
echo $content;
$sql="update home set content='$content'";
$result=mysql_query($sql) or die(mysql_error());

You can see the second echo statement. I added it to debug the problem. Data is shown perfectly in this echo. The problem rises in the query I suppose.

  • 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-08T15:07:29+00:00Added an answer on June 8, 2026 at 3:07 pm

    It looks like all the code on the server side is working properly. The error seems to be happening when the browser submits the form back the server and then either the data is wrong or is mis-interpreted.

    1) Please can you confirm that you have the Multi-Byte extension installed. If you don’t then PHP will probably be failing to interpret the characters from the browser correctly. http://php.net/manual/en/book.mbstring.php

    2) Can you double-check that the page is actually picked up as UTF8 by the browser. It is possible that the browser isn’t sure what character set the page is in, but is still displaying the Arabic characters correctly because it’s guessing how to display them. So first.

    In your HTML, add this meta tag:

    Also add this PHP header at top of the script:

    header(“Content-Type: text/html;charset=UTF-8”);

    3) If those don’t work please can you look at the actual form submission in the browser, either using the developer tools in Chrome or Firebug in Firefox to see exactly what is being submitted.

    e.g. I just did a test page to submit some Arabic text to a test page on my server. In the request I can see the form is encoded as

    Content-Length: 61
    test=%26%231607%3B%26%231594%3B%26%231594%3B%26%231601%3B&go=
    

    Splitting the text into individual characters I can see

    %26
    %231607
    %3B
    %26
    %231594
    %3B
    %26
    %231594
    %3B%26
    %231601
    %3B
    

    i.e. the Arabic characters are being encoded correctly for me – perhaps you would see something different.

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

Sidebar

Related Questions

I've been trying to google this but have been unable to find a solution
I've been trying for hours to find a solution this problem but have not
I have been trying to find a solution to this one but could not
I have been trying this for a while but can't find the right solution.
Over the past few days, I have been trying to find an answer to
I have been trying to find a solution for this for a while but
I have been trying to find a solution to this everywhere but am stumped.
I have been trying so much but have no solution find out yet. I
I have been trying to find decent Image Acquisition + Image Processing solution at
I have a problem that I have been trying to find a solution for

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.