Hi there,
I am using CodeIgniter for a few weeks now and I am impressed.
But after migrating one project from a LAMP to a Windows Apache MSSQL2012 PHP7.0 machine my troubles started.
As mssql isn't available within PHP 7 I took sqlsrv and installed it, tried to connect worked from first attempt. So far this could be a success-story, but it is not. On updates I get the message:
My models use statements like:
I don't know why and when CI comes to the conclusion it would be great to insert the "id"-field into the SET-part of my update query, but it is not great - I already thought it would be a great idea for the id field to be identity(1,1) and mssql doesn't want queries to mess around with these.
Is there an easy and obvious solution I missed or am I doomed to write my own database-connection?
I am using CodeIgniter for a few weeks now and I am impressed.
But after migrating one project from a LAMP to a Windows Apache MSSQL2012 PHP7.0 machine my troubles started.
As mssql isn't available within PHP 7 I took sqlsrv and installed it, tried to connect worked from first attempt. So far this could be a success-story, but it is not. On updates I get the message:
Quote:A Database Error OccurredThe generated update-query looks like this:
Error Number: 42000/8102
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Die id-Identitätsspalte kann nicht aktualisiert werden."
The last part basically means "The ID-identy column may not be updated."
Code:
UPDATE "dbo"."table" SET "id" = 1, "someStuff" = stuffValue WHERE "id" = 1My models use statements like:
Code:
$data = array (
'someStuff' => (int) $stuff
);
$this->db->update('table',$data,"id = ".$itemID);Is there an easy and obvious solution I missed or am I doomed to write my own database-connection?