I uploaded csv file using phpmyadmin, and it is correctly uploaded and data is displayed correctly as showing in the following image. Table Structure  Data in the Database  But on browser it is showing like this, means unreadable just ????? Showing on the page.  Here is how i am getting data using php function get_quran_surat(){         $query =&quot;select suraid,suraname from quran group by suraid,suraname&quot;;         $result=$this-&gt;query($query);         $this-&gt;setcharset();         $rows=array();         while($row=$this-&gt;fetch_array($result)){             $rows[]=$row;         }         return $rows;    }  Also add the utf-8 in head section of the page.  Edited Table Structre  Question How can i show readable data in the browsers ?
326
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
836
I'm writing a php program that pulls from a database source. Some of the varchars have quotes that are displaying as black diamonds with a question mark in them (�, , I assume from Microsoft Word text).  How can I use php to strip these characters out?
10511
I have two issues with a csv file that occur when I try and edit it in Excel.   I have an ISBN column that gets reformatted to scientific format every time I save the file The encoding for the file is changed from UTF-8 to ANSI when I open the file.   It is really, really frustrating and a complete waste of time.  Is there any way that I can force Excel to leave the format of the file alone?
115591
In a fairly unique situation, my team has ended up with UTF-8 bytes in a database that thinks the data is encoded as latin1.  At least, I'm 85% certain that this is the situation at hand.  For example, a  was handed to the database by  and just treated the data as raw bytes (0xE2 0x80 0x99). This data, as far as I can tell (how to verify?), was stored as those actual bytes. So now when the data is read out by a more intelligent programming language (Ruby 1.9), the database helpfully says , and so instead of "Mike’s", we end up with "Mikeâ€™s". This is also what I get in the mysql prompt when SELECTing that value.  So, essentially, we have a bunch of utf-8 encoded data stored in a database that thinks the data is encoded as latin1.  This makes me to somehow tell the database "No, no matter what you think, this stuff is actually utf-8". CONVERT TO doesn't seem like the right tool, because then I'll end up with permanent "Mikeâ€™s".    Failed/moronic attempt #1  I noticed this:  &gt; SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; +--------------------------+-------------------+ | Variable_name            | Value             | +--------------------------+-------------------+ | character_set_client     | utf8              | | character_set_connection | utf8              | | character_set_database   | utf8              | | character_set_filesystem | binary            | | character_set_results    | utf8              | | character_set_server     | latin1            | | character_set_system     | utf8              | | collation_connection     | utf8_general_ci   | | collation_database       | utf8_unicode_ci   | | collation_server         | latin1_swedish_ci | +--------------------------+-------------------+   And thought that maybe changing character_set_results to latin1 would trick it into not doing any conversion of the bytes, resulting in the proper display of data on my utf8 OS.  Sure enough, SET character_set_results=latin1; results in ’ instead of â€™. Cool!  So I added this to my ~/.my.cnf (which is the only my.cnf, I checked):  [mysqld] ... character-set-results=latin1   and when I go back to the MySQL prompt &amp; check the character_set_% variables, it's still utf8.  Yes, it just occurred to me that mysqld is a deamon, which means I probably need to restart the whole mysql process for this to take effect. But whoever installed MySQL on this machine used the dmg instead of the brew (wasn't me!) and the MySQL pref pane is currently telling me that MySQL isn't running even though it clearly is, and anyhow before I go down that rabbit hole, I want to check with an actual DBA and see how ridiculous this is, or if there's just a better, cleaner way to do it.
47900
In my little age with WordPress, I've seen WordPress itself and its friendly plugins are using PHP serialize() in storing data into db in many cases. But in a recent search I found a serious community support for the json_encode() over the serialize().     And I personally tested an associative array with both of 'em, that shows:  serialize() stores 342 chars json_encode() stores 285 chars  Why I'm asking this? I'm on a project while I'm going to store repeating meta fields to a post. Where:  Data would be basically in English, but sometimes can be Bengali Data would be associative array, 3 level deep (I hope I understood levels correctly):   array(     1 =&gt; array(         'key'=&gt;'value',         'key2'=&gt;'value'     ),     2 =&gt; array(         'key'=&gt;'value',         'key2'=&gt;'value'     ) )  I've checked the postmeta table's meta_value field it's a longtext,  a length of 4,294,967,295 chars (4GB). So I need a robust solution into storing things.
23902
In MySql's interpreter, it's very easy to dump a table to the screen along with its field names.   There seems to be no simple way to export a table to a tab-delimted or CSV outfile including its column headers.  I'm trying to do this using only SQL or the Linux command line, without writing a program in another language.  Thank you
17694
I can read the MySQL documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect?  I'm asking for an explanation of the two and how to choose them.
36687
I have created webform with title, description and upload file fields. And I have created views to display submission data in a grid view.   For images, it just giving me the image name with URL to image but it is not displaying as an image. I tried everything, but didn't find any solution. Please give me solution for displaying images in views.
48211
Im using smarty and mysql_real_escape_string() for user input, and when I insert some code with ' or " , and lookup in phpmyadmin it shows without backslashes.  When I get record from DB i doesn't have backslashes also. But when I just pass escaped string without inserting into the db it is backslashed.  Shouldn't it add slashes, insert with them and then I would  strip them when i would output? Or am I missing something?
99906
One of the responses to  suggested that I should make sure my database can handle UTF-8 characters correctly. How I can do this with MySQL?
19261
I have a datetime column in MySQL.   How can I convert it to the display as mm/dd/yy H:M (AM/PM) using PHP?
49731
When I typed the title I was directed to another question "". My experience is somewhat different than discussed there. The display is correct in LibreOffice and Text Editor but not in browser search results page. Again if you click the link with incorrect display the actual website displays correctly. I experimented with copying the incorrectly displayed lines and pasted in text editor and it displayed correctly.   This problem seems to be only in Debian/Ubuntu and distros based on them. I have tried a few other distros like Fedora, Manjaro and Solus and everything is displayed correctly in them.
107191
At the moment, I have created a code that retrieves data from the database and displays it. However, for some reason, I cannot see the files I want to retrieve on my page. My goal is that the data gets retrieved from the database, and is displayed on the webpage. I do not need to make a connection with the database since Wordpress does that automatically.  My code:  &lt;?php  global $wpdb; // this adds the prefix which is set by the user upon instillation of wordpress $table_name = $wpdb-&gt;prefix . "wpex_programma"; // this will get the data from your table $retrieve_data = $wpdb-&gt;get_results( "SELECT * FROM wpex_programma; " ); print_r($retrieve_data); ?&gt; &lt;ul&gt; &lt;?php foreach ($retrieve_data as $retrieved_data){ ?&gt; &lt;li&gt;&lt;?php echo $retrieved_data-&gt;column_name;?&gt;&lt;/li&gt; &lt;li&gt;&lt;?php echo $retrieved_data-&gt;another_column_name;?&gt;&lt;/li&gt; &lt;li&gt;&lt;?php echo $retrieved_data-&gt;as_many_columns_as_you_have;?&gt;&lt;/li&gt; &lt;?php  } ?&gt; &lt;/ul&gt;   My question: the data is not shown and I believe it is not retrieved. How can I fix that? The table name is correct, and I have data in my database tabel. The print_r($retrieve_data)returns the following: Array ( [0] =&gt; stdClass Object ( [id] =&gt; 35 [naam] =&gt; /public_html/wp/wp-content/plugins/AbonneerProgrammas/FilesUpload/Country Kickin 1.mp3 ) )  My query log:    My database structure:   New:  &lt;?php  global $wpdb; // this adds the prefix which is set by the user upon instillation of wordpress $table_name = $wpdb-&gt;prefix . "wpex_programma"; // this will get the data from your table $retrieve_data = $wpdb-&gt;get_results( "SELECT * FROM wpex_programma; " ); print_r($retrieve_data); ?&gt; &lt;ul&gt; &lt;?php foreach ($retrieve_data as $retrieved_data){ ?&gt; &lt;li&gt;&lt;?php echo $retrieved_data-&gt;id;?&gt;&lt;/li&gt; &lt;li&gt;&lt;?php echo $retrieved_data-&gt;naam;?&gt;&lt;/li&gt; &lt;?php  } ?&gt; &lt;/ul&gt;
123297
I have the following code  &lt;?php if ($handle = opendir('C:/xampp/htdocs/movies')) {     while (false !== ($file = readdir($handle))) {         if ($file != "." &amp;&amp; $file != "..") {             echo $file."&lt;br /&gt;\n";         }     }     closedir($handle); } ?&gt;   When it does have mb language such as japanese, it doesn't display properly instead it display like kyuukyoku Choujin R ?????~? rather then kyuukyoku Choujin R 究極超人あ～る  Anyway to make it display the correct name or make it still download-able by others?  Thanks for helping me :)
40533
Oh man, I don't even know where to put this... or how to begin. As a joke, I'm trying to get the ascii art of the guy flipping a table in a question on an exam. I've tried verbatim but it won't display the characters.  I know it might be a long shot, but does anyone have an idea how to get this little guy  (╯°□°）╯︵ ┻━┻   to display? I know I should provide a MWE, but... yeah, I don't even have that.  Thanks!
68661
Can we directly load a CSV file ( which is on the local system) on MYSQL DB ( which is installed on the Remote server ) ?  'load data infile into table name' command can only be used for loading in local system only.
10295
We're building a web-based platform where the main dashboard shows a table of data for users to view and analyze. As we're growing this tool, we seem to be adding more and more columns and are running out of horizontal space on smaller screen resolutions (we're seeing some data wrap). It is important to the user to view all columns at once, so column hiding is somewhat out of the question, as is horizontal scrolling (per the boss's request and because horizontal scrolling sucks anyways). I was wondering if anyone knew of a clever UI for tables with many columns.  EDIT  Below is a screen capture of the layout of the table. Unfortunately for security purposes I had to blur out the column titles. This example has rows with practically no data in them, but in use they will have lots of data that will expand wider than their respective column titles. In response to some of the answers, it is imperative that the user see all the columns, as they are all necessary to analyze the data to make certain decisions. All the data is numeric aside from the first three columns. Thanks again for any feedback.    Ok so I see that uploading this image doesn't really do it justice... it takes up the full width of the screen at 1680x1050 resolution (22") and as data fills in the columns, the left column w/the text shrinks down a bit.  EDIT 2 I just wanted to say thank you to everyone's awesome ideas. I can only select one answer, but a lot of your ideas have proven very useful and may end up in the final product. Thanks again!