smokeelow
(Smokeelow)
December 2, 2012, 9:23pm
1
Hi all.
Work with MSSQL, using pdo_sqlsrv driver(PHP 5.4. .
In my DB I have column with varbinary type and size of it == 7584.
When I try get value from this column I get error "Invalid sql_display_size in G:\…\…\…\framework\yiilite.php on line 8836 ".
Here query:
$model = Character::model()->find(array(
'select'=>'Inventory',
'condition'=>'Name=:Name',
'params'=>array(':Name'=>'JohnDoe')
));
Maybe someone encountered this problem and can help me.
P.S. Sorry for my bad english)
konapaz
(Konapaz)
December 2, 2012, 10:14pm
2
I think this is a PDO MSSQL driver and not Yii bug according to
https://bugs.php.net/bug.php?id=55083
smokeelow
(Smokeelow)
December 2, 2012, 10:46pm
3
But last update of mssql drivers was 10/03/2012 I hope they fixed bugs like this, now I think problem in other.
If it is true and there are no solution it’s very sad).
konapaz
(Konapaz)
December 2, 2012, 11:03pm
4
smokeelow:
But last update of mssql drivers was 10/03/2012 I hope they fixed bugs like this, now I think problem in other.
If it is true and there are no solution it’s very sad).
I agree with you that is very sad if it is a bug of PDO
Please send a bug report to
https://bugs.php.net/report.php
smokeelow
(Smokeelow)
December 3, 2012, 9:57am
5
I found solution for my situation. But…
Here query:
DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item;
In this case I get exactly that size that I need. It work in normal php query (not PDO) and in MSSQL Managment Studio.
When I run this code in Yii:
$query = "DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item";
$command=Yii::app()->db->createCommand($query)->query();
$command->read();
I get this:
I think that I wrong built query.
My question how run query like this in Yii.
konapaz
(Konapaz)
December 8, 2012, 10:10pm
6
smokeelow:
I found solution for my situation. But…
Here query:
DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item;
In this case I get exactly that size that I need. It work in normal php query (not PDO) and in MSSQL Managment Studio.
When I run this code in Yii:
$query = "DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item";
$command=Yii::app()->db->createCommand($query)->query();
$command->read();
I get this:
I think that I wrong built query.
My question how run query like this in Yii.
Check the below links
http://social.msdn.microsoft.com/Forums/en/sqldriverforphp/thread/fd6015cd-d42f-470d-b8c7-ae9e6786f59c
I have a new install of PHP with Apache 2.2 on a Windows XP box and am getting the following error when using this line of PHP: mssql_connect($server,$username,$password) or die (Could not connect); Warning: mssql_connect() [function.mssql-connect]:...
JFReyes
(Jose Reyes)
December 5, 2013, 8:51pm
7
@smokeelow :
Did you ever find a solution for your question? Please let me know.
Thanks,