0

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.

Zhorov
  • 28,486
  • 6
  • 27
  • 52
sumit
  • 15,003
  • 12
  • 69
  • 110

1 Answers1

0

I think the problem is that there's no MS-SQL driver for PHP installed on the Linux server.

OnoSendai
  • 3,960
  • 2
  • 22
  • 46
Reinstar
  • 146
  • 1
  • 1
  • 21