PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 30, 2022

[FIXED] No ODBC database schema in Yii?

 January 30, 2022     odbc, php, sql-server, yii     No comments   

Issue

I'm looking at the source files for Yii 1.1.5, and I don't see a database schema for ODBC. When I use this connection string in my config file:

'db'=>array(
  'connectionString' => 'odbc:rhinestone',
  'username' => 'user',
  'password' => 'pass',
),

I get this error:

"CDbConnection does not support reading schema for ODBC database."

However, I can use that connection string in regular php and connect just fine:

$dbh= new PDO('odbc:rhinestone', 'user', 'pass');

So I know it's not an issue with my drivers or with PHP.

Why does Yii not support ODBC? Is this going to change? I'm trying to connect to MSSQL from a linux server and it seems like the pdo mssql and dblib drivers are either experimental or deprecated.

Does anyone have any advice on how to do this?

UPDATE: I've received a number of suggestions so far all making the assumptions that I'm running PHP on Windows. This is not the case. I'm running it on Linux, and I have to connect to a SQL Server database for a project.


Solution

The answer to this question is that, as of this writing, Yii does not have a schema for pdo_odbc. And as far as I can tell, they do not have plans to write one. If anyone hears otherwise, please let me know.



Answered By - Philip Walton
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing