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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:10:50+00:00 2026-06-10T01:10:50+00:00

i have a database in MsSQL, with which i connect from my PHP code

  • 0

i have a database in MsSQL, with which i connect from my PHP code through PDO objects.
the database has column “Kadź”.

Now – if i execute a

SELECT Kadź FROM <tablename>

query from my SQL Server Management Studio – everything works fine, i get the results.
However, when i try to execute a

$sql = "SELECT Kadź FROM <tablename>";

i recieve a

SQLSTATE[HY000]: General error: 207 General SQL Server error: Check messages from the SQL Server [207] (severity 16) [(null)]

error.
Querying any other column doesn’t produce any problems, but this one does. I suspect it’s because of that “ź” character in the name of this column, that is unproperly encoded on the route between my PHP code and the database.

The collation used by my server is “Polish_Cl_Al”.
i’ve tried fixing it by adding attribute

$this->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAME'utf8'");

but the PDO answered me, that the driver doesn’t support it…

thanks in advance for any help

  • 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-10T01:10:53+00:00Added an answer on June 10, 2026 at 1:10 am

    You can try:

    $pdo = new PDO('dblib:host=localhost;dbname=databasename;charset=UTF-8', 'username', 'password');
    

    or (for windows)

    $smth->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php code which generates a list from a field in mysql
I have the following php code, which has been snipped for brevity. I am
I have a page called list.php which retrieves from database and shows all the
i have a mysql database from which i require an rss feed of its
i have come across a mysql database which has dates entered in a varchar
I have an article in which I use PHP code inside the text editor
I have two .php files which show all contacts in a database, then allows
I have an application which gets some data from a remote database. I use
I currently have a PHP file which will search my MySQL database and see
I have a experiment which displays the random images from the database and the

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.