我收到此错误
数组([0] =>数组([0] => IMSSP [SQLSTATE] => IMSSP [1] => -14 [代码] => -14 [2] =>无效参数传递给sqlsrv_query。[message] =>将无效参数传递给sqlsrv_query。))
代码是:
$sql_query = "UPDATE Subscription SET Status = ? where SubscriptionID = ?";
$params = array(1, $subscription_id);
$stmt = sqlsrv_query( $conn, $sql_query, $params);
if( $stmt === false ) { echo " Error occurred while updating in database. ";
die( print_r( sqlsrv_errors(), true));}
else {echo " Database updated successfully.";}
有人请帮帮我......谢谢
答案 0 :(得分:1)
要对此进行更多调试,您是否可以在查询中代替?
对代码进行硬编码,看看它是否有效或是否失败? $params
是sqlsrv_query
问题是$conn
为空。