FAQ Database Discussion Community


execute stored procedure with parameters using PHP ADODB, MSSQL sqlsrv

php,sql-server,stored-procedures,adodb,sqlsrv
Help me to execute stored procedure with parameters using PHP ADODB, MSSQ. $stmt = $db->PrepareSP('VM_SEARCH_SMSC');//stored procedure VM_SEARCH_SMSC $search = 'test'; $string = 'SearchString'; $db->InParameter($stmt,$search,$string); //return values. $data = array(); $data['SNo'] = 0; $data['SNSCID'] = 0; $data['SMSCNAME'] = 0; $data['MODE'] = ''; $data['ISACTIVE'] = 0; $data['FIELD1'] = 0; $data['ISBIND'] = 0;...

Using PHP insert current date time in sql server via sqlsrv drivers

php,sql,sql-server,datetime,sqlsrv
Till now I have tried $sql = "INSERT INTO table-name(col-name) values (cureent_timestamp)"; and have set the column data type as datetime , I get some values but no date or time....

Call Store Procedure in PHP using sqlsrv driver

php,sqlsrv
I'm trying to call procedure in PHP using SQLSRV driver of microsoft. Here is my storeprocedure, calling function. But it shows me error that "Error in executing statement. Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -14 [code] => -14 [2] => An invalid...

sqlsrv_query doesn't return false on faulty T-SQL query

php,sql-server-2005,error-handling,sqlsrv
I'm using sqlsrv to connect to a MSSQL database. A feature in a secured (and only available to a few people) intranet application provides a box to write T-SQL code and execute them to the database. At this moment I'm working on a feature to test the given query. First...

SQLSRV Query Returning Output Parameter As Strange Text

php,sql,sql-server,stored-procedures,sqlsrv
I have a stored procedure in SQL Server 2012 which first checks if data exists, if it does then it sets the Output parameter @Return to 1 and runs a select query and if not, sets @Return to 0 and returns a different select query. When testing this stored procedure...

Error connecting to MSSQL using PHP

php,sql-server,pdo,odbc,sqlsrv
I am receiving an error as below: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08001]: [Microsoft][ODBC Driver 11 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. ' My codes are as follow: $this->link = new PDO( "sqlsrv:server=$this->serverName:$this->port;Database=$this->db", "$this->uid", "$this->pwd" ); I wish someone can enlighten...