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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:10:04+00:00 2026-05-23T18:10:04+00:00

I have to use MS SQL Server 2008 to store data of PHP CAKE

  • 0

I have to use MS SQL Server 2008 to store data of PHP CAKE application.

I successfully installed the Microsoft’s PDO driver for PHP and the dbo datasource of php cake.

My application communicate with the server.

But I’ve some problem with encoding and I don’t know how to manage.

I made some research and it appears that SQL server doesn’t really support utf8 for varchar fields(if I correctly understood).

SQL Server tells me, with the “SELECT SERVERPROPERTY(‘Collation’)” query, that I’ve the French_CI_AS encoding(which seems to be correct).

I made some search php cake config, and it appears that we can specify an “encoding” parameter for the database config (in app/config/database.php). I tried to set it to the French_CI_AS, and utf8, but it doesn’t change anything, I still have unrecognized caracters on my page.

I’m not sure that the sql server data source is actually using this parameter, so I searched into the dbo_sqlsrv.php, and I found a “charset” property, so I set it to “SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES”, but now I’ve another error, cake doesn’t find anymore my table:

Warning (2): sqlsrv_query() expects parameter 1 to be resource,
boolean given [CORE\cake\libs\model\datasources\dbo\dbo_sqlsrv.php,
line 185] Warning (512): SQL Error: An invalid parameter was passed to
sqlsrv_query. [CORE\cake\libs\model\datasources\dbo_source.php, line
684] Query: SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
Missing Database Table Error: Database table moniteurs for model
Moniteur was not found. Notice: If you want to customize this error
message, create app\views\errors\missing_table.ctp

But if I run myself this command, I clearly see this table:

TABLE_NAME

garagistes

moniteurs

(2 row(s) affected)

and like you can see, I don’t even have any non-ascii char in my table names.

So I’m little lost and I don’t know where to search now, do you have any idea?

Thank you!

  • 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-23T18:10:05+00:00Added an answer on May 23, 2026 at 6:10 pm

    I finally found the solution!

    I had to convert all my fields in nvarchar instead of varchar, and set the charset of my php database configuration file to “UTF-8″(the “-” is matters):

    var $default = array(
            'driver' => 'sqlsrv',
            'host' => 'localhost',
            'login' => 'myUser',
            'password' => 'myPassword',
            'database' => 'myDatabase',
            'prefix' => '',
            'charset'=>'UTF-8'
        );
    

    Now everything appears in the correct encoding!

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

Sidebar

Related Questions

We have a SQL server database. To manipulate the data non-programmatically, I can use
(ANSWER) How to export some Geography data from a Microsoft Sql Server 2008. You'll
We have customers who, for unassailable reasons, cannot use SQL Server's built-in backup features
I use an sql server regularly and have recently been getting frustrated by the
Is it recommended to use two versions of SQL Server (2005 and 2008) for
I have added Full Text Search to my sql server 2008 express database and
I'm trying to store a document in SQL Server 2008 using the Entity Framework.
I have created an application that makes use of database. Can I use SQL
Traditionally, when we use SQL string to done some work, we have to close
I've just started to use linq to sql and have run into a problem

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.