Interesting choice of an error description. Not at all clear.
Try this: if (false === ($stmt = sqlsrv_query($conn, $sQry, array_values$aSubmitted)))) and see if that makes a difference. *Sounds* to me that it doesn't like associative arrays, which of course makes no sense.
Fantastic, this is working great so far. you guys are awesome. I promise after this project I am never messing with PHP and MsSQL again, going back to MySQL, maybe I wont have to bug you guys as much then anyways thanks a bunch. Ima go make a new post.
/**
First thing, we create a function that will make your data safe!
**/
function mssql_escape($data) {
if(is_numeric($data))
return $data;
$unpacked = unpack('H*hex', $data);
return '0x' . $unpacked['hex'];
}
if (isset($_POST['LOWNUMBER'])) {
$aAllowed = array( 'StreetPrefix',
'StreetName',
'StreetSuffix',
'StreetPostDir',
'COMMUNITY',
'LOWNUMBER',
'HighNumber',
'EOB',
'ESN',
'TELCO',
'PostOffice',
'ZONE',
'MAP',
'DateEntered',
'DateUpdated',
'Comment',
); // all the allowed items.
function removeUnknowns(&$item, $key, array $aAllowed)
{
if (!in_array($key, $aAllowed))
{
$item = "";
}
}
/** First thing, we create a function that will make your data safe! **/ function mssql_escape($data) { if(is_numeric($data)) return $data; $unpacked = unpack('H*hex', $data); return '0x' . $unpacked['hex']; }
To create 'examples' database on your MSSQL Server you should run the following script:
CREATE DATABASE examples;
USE examples;
CREATE TABLE cars(
id int UNIQUE NOT NULL,
name varchar(40),
year varchar(50),
PRIMARY KEY(id)
);
INSERT INTO cars VALUES(1,'Mercedes','2000');
INSERT INTO cars VALUES(2,'BMW','2004');
INSERT INTO cars VALUES(3,'Audi','2001');