Welcome Guest, Not a member yet? Register   Sign In
Error in mssql_driver.php 1.6.1

I was just playing around with the scaffolding and had it going with CI 1.6.0. I just upgraded to 1.6.1 and now I get the error:

An Error Was Encountered
Error Number:

SELECT COUNT(*) AS "numrows" FROM "Individuals"

I tracked it down to the mssql_driver.php, the new function that was added at line 433. I don't know how to correct it, but that seems to be the problem.

Is any one else seeing that too and any ideas how to fix it?


[eluser]Late Night Again[/eluser]
Yes I am getting the same error

SELECT "EventID", "Title" FROM "table" ORDER BY "StartDate"

trying to find what is causing it now.

[eluser]Late Night Again[/eluser]
I do not know if this is the correct fix but it has resolved my problem, here is what I have dont.

mssql_driver.php - line 461

$item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1"$2"$3', $item);

$item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1$2$3', $item);


line 465

return "\"{$item}\"";

return "{$item}";

This may not be a correct fix but hopefully will help you out till there is a bug fix.

Thanks! That seemed to work for me too. We'll see what the higher-ups say about it hopefully.

That fixed my problems as well. This should really be rolled out in the next release!

[eluser]Derek Allard[/eluser]
Sure thing. Has this been reported in the bug tracker?

I just did. Thanks!

I doubt I would have caught the error on my own, thanks a lot for sharing this fix!

What version of SQL Server is everyone connecting to?

[eluser]Derek Jones[/eluser]
That fix just removes the quotes from the preg_replace and return values, which means that you're neutering the _protect_identifiers() method in that driver entirely. I don't have anything to test on, so are you saying that that is indeed what needs to happen? If that's the case, then just replacing that entire method's code with:

return $item;

would be the correct solution.

Theme © iAndrew 2016 - Forum software by © MyBB