0

I am getting the above error using PHP trying to update an MS SQL server. Any idea what may be happening here? I am using a stored procedure as the basis of the update. I can successfully execute the sproc against the SQL server away from the PHP application.

Any advice/help would be appreciated.

1
  • If you post a code example it would make it easier to help. Commented Jun 10, 2009 at 20:48

2 Answers 2

3

mssql_fetch_array() should be used for SELECT commands, you won't get anything out of UPDATE, INSERT, or DELETE commands.

You can also pass a parameter to the resource by calling mssql_fetch_array($connection) assuming $connection is a valid connection to the DB.

Sign up to request clarification or add additional context in comments.

Comments

0

Always test the return value of mssql_query(). If it's ===false mssql_get_last_message() can tell you why the query failed.

$query = 'SELECT x,y,z FROM [foo].[bar].[thingeling]';
$result = @mssql_query($query, $conn);
if(!$result) {
  die('MSSQL error: ' . mssql_get_last_message());
}

For debugging purposes you might want to set mssql_min_message_severity and mssql_min_error_severity to more "talkative" values.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.