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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:53:24+00:00 2026-05-24T03:53:24+00:00

I am not very experienced with database and php and I have a problem.

  • 0

I am not very experienced with database and php and I have a problem.

I have made a simple database in phpadmin on a webserver with a table called NEWS with 3 columns called int ID, text RUBRIK, text ARTICLE.

When i use SELECT * FROM NEWS the result from ID and RUBRIK works well but the result from ARTICLE returns "null". Do anyone know what is wrong.

In phpmyadmin it works perfect to add column with text that contains the swedish letters and in phpmyadmin it is possible to see the stored text in a correct way, it is when the text is called to the php it wont work.

I use a index.php file interact with the database, because index.php is just working for connecting my android application with the database the answer from index.php is print(json_encode($output));

PS, I have tried saving the index.php file in MS Notes with ANSI and UTF-8 coding. Makes no difference, I have tried manipulating my database by changing all collations I can find in the phpmyadmin between latin1_general_ci, utf8_general_ci, utf8_general_bin, utf8_swedish etc etc.
I have also tried the command mysql_query("set names utf8"); which I was recommended to try, using that made the database return the letters in the similar to "/&aumi".

Would really appreciate if anyone could help me.

Here is the php file.

<?php 
   $con = mysql_connect("mysqlserver","user","passwords");

   if(!$con)
   {
       die(' funkar ej: ' . mysql_error());
   }

   mysql_select_db("database", $con);

   $q=mysql_query("SELECT * FROM NEWS");

   while($e=mysql_fetch_assoc($q))  
       $output[]=$e;

   print(json_encode($output));

   mysql_close();
?>
  • 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-24T03:53:25+00:00Added an answer on May 24, 2026 at 3:53 am

    Try encoding inside the php with utf8_encode ( string $data ) Encoding each $e with it.

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

Sidebar

Related Questions

( Updated a little ) I'm not very experienced with internationalization using PHP, it
I'm a long time developer but not very experienced with DNS. Here's my problem:
Question related to PHP memory-handling from someone not yet very experienced in PHP: If
I am not very experienced with either programming or scripting database queries, and I
I have a substantial database... not a very large one - around 1gb of
Building a Django app on a VPS. I am not very experienced with setting
Forgive me if this is a stupid question. I am not very experienced with
I am not a very experienced C++ programmer, i get a warning when i
I'm very new to AD LDS and experienced but not qualified with SSAS, so
Hi I have some experience with programming but I'm not very good with pointers.

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.