Go Back   Access World Forums > Apps and Windows > Web Design and Development > PHP & MySQL

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-21-2015, 09:04 AM   #1
MBMSOFT
Newly Registered User
 
Join Date: Jan 2010
Location: ohrid, macedonia
Posts: 79
Thanks: 3
Thanked 1 Time in 1 Post
MBMSOFT is on a distinguished road
I need to retrieve Cyrillic data from MSSQL database with PHP but I get back "???????

I need to retrieve Cyrillic data from MSSQL database with PHP but I get back "???????"

Code:
<?php

   $dbconn = new PDO('odbc:Driver=FreeTDS; Server=xxx.xxx.xxx.xx; Port=1433; Database=xxxxxx; UID=xxxx; PWD=xxxxx; )');

   if ($dbconn->connect_error) {die("Connection failed: " .    $dbconn->connect_error);}

    //$dbconn->debug = true;
    
$sql="select data1 from myTABLE where data2 ='text' ";

    $query = $dbconn->query($sql);
    $query->execute();
    $rs = $query->fetchColumn();

echo $rs;
?>
Result is "?????" instead of cyrillic text
Any idea how to get non-unicode characters from mssql database
Thanks...

MBMSOFT is offline   Reply With Quote
Old 09-03-2017, 04:37 AM   #2
youyiyang
Newly Registered User
 
Join Date: Apr 2009
Location: China
Posts: 49
Thanks: 8
Thanked 6 Times in 6 Posts
youyiyang is on a distinguished road
Re: I need to retrieve Cyrillic data from MSSQL database with PHP but I get back "???

the problem is in your client side.
use this in your client side html page:
<meta charset=utf-8>
references:
https://technet.microsoft.com/en-us/...=sql.105).aspx

https://stackoverflow.com/questions/...oding-cyrillic
youyiyang is offline   Reply With Quote
Old 09-03-2017, 04:56 AM   #3
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,610
Thanks: 59
Thanked 2,438 Times in 2,338 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: I need to retrieve Cyrillic data from MSSQL database with PHP but I get back "???

Uh, check the post date.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 01-04-2019, 11:37 AM   #4
abubasil
Newly Registered User
 
Join Date: Aug 2011
Posts: 27
Thanks: 2
Thanked 3 Times in 3 Posts
abubasil is on a distinguished road
Re: I need to retrieve Cyrillic data from MSSQL database with PHP but I get back "???

A new reply for an old question for anyone drop in here.

The solution is to set the database, tables , and fields collation to utf8_unicode_ci.
as for the php files make them encode utf8 in BOM .

abubasil is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve data from other table in Access 2010 web database irslan rafique Access Web 0 11-03-2014 06:22 PM
Back to work on an old project and greeted with "unrecognized database format" Jon-G General 8 06-20-2013 07:44 AM
How to fill "Local Tables" with Password Protected back-end database tables Khalid_Afridi Tables 8 11-01-2012 06:45 AM
Retrieve email data to database NigelShaw General 3 02-13-2009 09:58 PM
Data Insert...getting back the "autonumber" value. Chatbox Modules & VBA 11 10-18-2004 02:17 PM




All times are GMT -8. The time now is 04:05 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World