How to insert Khmer text into SQL Server 2008 - php

I'm using Microsoft SQL Server 2008 SP2 for a database in which I need to write either Khmer Unicode or English letters.
And I code website by Codeigniter.
My database is using Colattion: SQL_Latin1_General_CP1_CI_AS.
Type Column Name : nvarchar(250).
Query via Codeigniter php:
insert into Genres
(Name)
values(N'ការបង្ហាញ')
But in my database when I right click on table, select edit top 200 . The result for Name in table look like this:
ការបង្ហាញ
I want my result at Name Column is : ការបង្ហាញ
How to insert Khmer Text still not change in database?
Thanks.

It works for me if I change the collation of the table:

Related

How to remove unrecognized character via MySQL query or PHP code?

I have uploaded CSV via CLI command and in the CSV have used bullets with description column.
When it imported in MySQL its showing like boxes for reference we have also attached screenshot. i want to replace with <li> tag or any other character. But neither i am able to select and replace character in MYSQL nor vi PHP.
I have already try update table name set field = replace(filed,"spacial","") but character not recognized in MySQL query.
We can change on front-end with help of javascript. So, share your website single page link or HTML from top (id or class).
Thanks you guys for solutions but i got the solution to replace character bullet was not visible in database but i have tried and got luck. it was replaced luckily.
MYSQL update script for Magento 1 product short description and description update query. you can also run with your tables via replace table name and fields.
UPDATE catalog_product_entity_text SET value = REPLACE(value,'• ','') WHERE entity_id = 141047 and attribute_id in (73,74)

What is the best way to store Danish letters in a SQL Server database?

I work on a big website on a Linux server (PHP) and with a SQL Server database.
The SQL Server database uses collation SQL_Latin1_General_CP1_CI_AS.
I have a table (let us call it table1) that stores a lot of addresses who are selected from nominatim via a PHP script (script1) and stored in table1. It seems like the format of the addresses is HTML. The Danish letters (æøå) look fine on the website when selected from table1.
However I have made a PHP script (script2) that selects these addresses and dump them into another table (table2) on the same MS SQL Server (still collation SQL_Latin1_General_CP1_CI_AS). But the Danish letters look weird on the website when selected from table2. When script1 gets addresses from nominatim it is in JSON format, which is afterwards decoded.
$addressdetails = json_decode ( $addressdetails, true );
No other encodes or decoding is made here.
The following may also be a help. When I run phpinfo() I can see that the server has these settings:
PHP version 5.3.3
content type: text/html; charset=UTF-8
What is the best way to handle letters in PHP and SQL Server, so Danish and other special letters are shown the correct way on any platform?
Sounds like table1 has the address data in an NVARCHAR typed column whereas table2 has the address data in an VARCHAR typed column. NVARCHAR will happily handle æøå but VARCHAR with SQL_Latin1_General_CP1_CI_AS collation will not.
If both tables are using NVARCHAR to store the data then check that it's not getting converted to VARCHAR at any point between table1 and table2, for example, a VARCHAR stored procedure parameter .

Japanese language in sqlite db

I'm trying to create sqlite db with php (zend framework).
I have the next code:
$sqlite = Zend_Db::factory("pdo_sqlite", array("dbname" => "sqlite.db"));
$sqlite->query('CREATE TABLE IF NOT EXISTS newTable (word TEXT PRIMARY KEY, description TEXT);');
$sqlite->query("INSERT INTO newTable VALUES (\"".$word."\", \"".$description."\");");
Everything is fine and I can create db with needed text. But when I try to use Chinese or Japanese text my resulted db read slowly. I tried read it through php, sqliteman (app for edit sqlite), application on Android.
What should I change for obtain the same result as with English, Cyrillic or any other non-hieroglyphic language?
Thank you for your time!
Question closed. The problem was in very big amount of tables.

changing column encoding mysql to appear as arabic language

i have table in data base and there is a column have strange language like below '20795, '1818300', '33018964', '1022251015', 'Completed without ID number',
'ÔÇÑÚ ÇáãÑÛäì - ÇáÚãÇÑå ÈåÇ ãÍá ÓÇãÓæäÌ - ÈÌæÇÑ ÚãÇÑå ÇÈæÛÇáì - ÇáÏæÑ ÇáÓÇÈÚ-ÇáãÇÙå-ÇáÞÇåÑå'
but it was inserted as an arabic language using PHPRunner program .
my question is how to update that column to seen as arabic language in mysql .
i need to fix the old data .
note : values appeared normally on arabic language on the webpage
my problem how to change it in DB ,.
note : the format of this table , column is UTF8
You may easily set utf8 to your tables if you are using SQLYog.
Just right click on db, table, column name and click on alter option and set to
Database Chartset = utf8 Database Collation = utf8_general_ci .
Just Enjoy ....

Unable to retrieve unicode field from mysql to php

I have a database table where i want to store and retrieve in English and Nepali Language. I have a following configuration:
Type: InnoDB
Database collation : utf8_general_ci
Column name: Title_ne
Data Type: text
Column Collation: utf8_unicode_ci
Now when i insert data into Title_ne field using phpmyadmin and provide something like नमस्कार using Google Nepali input for Windows, it is inserted and displayed correctly while querying in phpmyadmin. But, while i query this from php and try to display it in php page, only ???????? is displayed. Am i doing something wrong on table design or inserting data? What is wrong, please provide your suggestions.
नमस्कार is a way of Greeting in Nepal.

Categories