I had written my project geared for MySQL... 15,000 lines of code. We hire a new IT manager who decides that MSSQL is the way to go. No amount of bribery will sway this man, not even a case of beer. So now I have to re-write portions of my code to work with MSSQL. Problem is, I haven't learned MSSQL, although I learned very quickly that my inserts and queries and database connections all went FUBAR. I fixed the db conns, but I still have issues with inserts and queries. For example, when trying to insert a new record, I get an error
Warning: MS SQL message: Cannot insert explicit value for identity column in table 'tad_casenum' when IDENTITY_INSERT is set to OFF.
because I am trying to insert a line that has an ID. First, I don't even know if I CAN insert a line with an ID, if I am to leave part of it blank (although I think not, because when I tried to leave part of it out it complained that there were not enough variables to match columns) or what the heck I am supposed to do.
Then, it doesn't like my query which is to select * from table_name.
Warning: MS SQL: Query failed in c:\blah\blah.php on line 20
My MSSQL book is somewhat useless, all my PHP books are geared towards MySQL, and after this afternoon, Google asked for a divorce.
Can someone explain how this MySQL query should look in MSSQL?
$sqlquery = "INSERT INTO casenum VALUES('','". $_POST['casenum'] ."','". $_POST['forumst'] ."','". $_POST['county'] ."','". $_POST['plaintiff'] ."','". $_POST['defendant'] ."')";
$queryresult = mysql_query($sqlquery) or die(" Could not execute mysql query !");
$sqlquery = "SELECT * from casenum";
Thanks