I have PHP on linux server and mssql 2005 on windows server, whenever i try to connect php with mssql , while executing stored procedure it give me error , my code is as below
mssql_connect('DBSERVER', 'sa', 'password');
mssql_select_db('tst');
// Create a new stored prodecure
$stmt = mssql_init('sp_report');
// Bind the field names
mssql_bind($stmt, '@username', 'test', SQLVARCHAR, false, false, 60);
mssql_bind($stmt, '@name', 'johndoe', SQLVARCHAR, false, false, 60);
mssql_bind($stmt, '@age', 19, SQLINT1, false, false, 3);
// Execute
mssql_execute($stmt);
How ever the code below is running fine
exec sp_report 'test','johndoe','19'
If i host php also on same server(the server where database resides) both codes are running fine.