I am currently successfully connecting to an SQL database located in Windows 2008 using the following query:
$result = mssql_query("EXEC dbo.stored_procedure_name @param_level = 2");
I base my queries on existing code written in VB / ADO that looks like this:
If level = "" Then level = 1 cmdTT.ActiveConnection = connStrTest1 set objParam=cmdTT.CreateParameter("@param_level", adInteger, adParamInput, 4, level) cmdTT.Parameters.Append objParam set rsTT = cmdTT.Execute
So, I tried to do the following:
$f = 2; $stmt = mssql_init('dbo.stored_procedure_name', $mssql_link); mssql_bind($stmt, "@param_level", $f, SQLINT4, false); mssql_execute($stmt);
But no matter what variation always seems printed, print a warning on the screen : " Warning: mssql_execute () [function.mssql-execute]: stored procedure execution failed ... ".
What is the best way for me to debug here? Can anyone see a clear fix for my problem?
I am now connecting remotely to the database from the LAMP stack.
Many thanks Ian
source share