sqlsrv

PDO::rowCount() returning -1

允我心安 提交于 2019-12-22 12:32:18
问题 i have this function below. that i used to run on a MySQL DB. I had to move to a SQL Server 2008 , easy thing. But, after that, the rowCount() keeps returning -1 , I've never had this happen before. I'm sure that my SQL query is returning the results, because if I do a print_r() on my return (the $rows var), everything gets printed. So, if anyone had this issue, please help me to figure this out. Sorry for any grammatical mistake. public function listar(){ $retorno = array(); $sql = "SELECT m

PDO::rowCount() returning -1

心已入冬 提交于 2019-12-22 12:31:36
问题 i have this function below. that i used to run on a MySQL DB. I had to move to a SQL Server 2008 , easy thing. But, after that, the rowCount() keeps returning -1 , I've never had this happen before. I'm sure that my SQL query is returning the results, because if I do a print_r() on my return (the $rows var), everything gets printed. So, if anyone had this issue, please help me to figure this out. Sorry for any grammatical mistake. public function listar(){ $retorno = array(); $sql = "SELECT m

How can I install pdo_sqlsrv on my windows 2008 Server 2008 R2? [closed]

假如想象 提交于 2019-12-18 09:45:49
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am trying to use PDO to connect to a SQL Server database. I have been struggling with it for a little bit now I get this Fatal error on my page where I am trying to connect to SQL Server Fatal error: Uncaught

sqlsrv drivers slow in codeigniter?

自闭症网瘾萝莉.ら 提交于 2019-12-18 08:39:48
问题 I have installed the latest version of CI 2.1.3 Now after running a query, I am getting a very slow response time for something very simple such as: function Bash(){ $sql = “SELECT * FROM Contacts”; $stmt = sqlsrv_query( $conn, $sql ); if( $stmt === false) { die( print_r( sqlsrv_errors(), true) ); } after querying a remote database. (Sql server 2008) When I run this same query in a simple PHP script against the same remote database. I get results instantly. a) Has anyone else experienced this

Calling stored procedure from PHP using PDO to MSSQL Server using INPUT Paramters

Deadly 提交于 2019-12-17 21:12:44
问题 This does not work: $dbh = new PDO("dblib:host=xxxx;dbname=xxx", "xxxxx", "xxxxx"); $sth = $dbh->prepare("{exec wcweb_UserInfo(?)}"); $sth->bindParam(1, $name); $sth->execute(); while($result = $sth->fetch(PDO::FETCH_ASSOC)) { var_dump($result); } This also does not work: $dbh = new PDO("dblib:host=xxxxx;dbname=xxxx", "xxxxx", "xxxx"); $sth = $dbh->prepare("{call wcweb_UserInfo(?)}"); $sth->bindParam(1, $name); $sth->execute(); while($result = $sth->fetch(PDO::FETCH_ASSOC)) { var_dump($result

How to connect to MSSQL 2000 from PHP 5.3 and up

两盒软妹~` 提交于 2019-12-17 19:02:55
问题 I have a legacy business application built on MS SQL Server 2000. I have some webbased utilities that access this database using PHP 5.2 with mssql extension. I need to reinstall the web server, and I looked forward to upgrade to PHP 5.4. Unfortunately, the mssql extension is not supported on PHP 5.3 and newer. There is the sqlsrv extension available form Microsoft, but the description says that it is only supported for accessing SQL server 2005 and up. How can I connect to my SQL Server 2000

How to connect to MSSQL 2000 from PHP 5.3 and up

会有一股神秘感。 提交于 2019-12-17 19:02:00
问题 I have a legacy business application built on MS SQL Server 2000. I have some webbased utilities that access this database using PHP 5.2 with mssql extension. I need to reinstall the web server, and I looked forward to upgrade to PHP 5.4. Unfortunately, the mssql extension is not supported on PHP 5.3 and newer. There is the sqlsrv extension available form Microsoft, but the description says that it is only supported for accessing SQL server 2005 and up. How can I connect to my SQL Server 2000

Codeigniter: How to setup connection to a SQL server (2008)

ぃ、小莉子 提交于 2019-12-17 17:14:57
问题 I've spent many days on this task, and I can't see the end until now. In the past day I managed to install sqlsrv driver on my PHP environment successfully but now when I try to connect I get this message: Unable to connect to your database server using the provided settings. My settings in application/config/database.php are so defined: $db['dbname']['hostname'] = "ENJ01\SQLEXPRESS"; $db['dbname']['username'] = "user"; $db['dbname']['password'] = "password"; $db['dbname']['database'] =

CI connect to SQL SERVER

折月煮酒 提交于 2019-12-13 05:16:07
问题 i want to connect to sql server my php version is 5.4 and i have MS SQL Server 2008 R2 and i use PHP Codeigniger 2.1.4 i use sqlsrv30.exe i use XAMPP 1.8.2 i change database.php config $db['default']['hostname'] = '192.168.5.208'; $db['default']['username'] = 'xxx'; $db['default']['password'] = 'xxx'; $db['default']['database'] = 'xxx'; $db['default']['dbdriver'] = 'sqlsrv'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default'][

SQLSRV_NUM_ROWS error

和自甴很熟 提交于 2019-12-13 00:38:12
问题 I have a PHP application for which I have tried creating a login script. When I try logging in I get the following error message: Warning: sqlsrv_num_rows() expects parameter 1 to be resource, boolean given It also shows 'Invalid Credentials' even though the username and password are correct. My code is as follows: if(isset($_POST['submit'])){ $user = $_POST['u']; $pass = $_POST['p']; //database connection $serverName = "localhost\SQLEXPRESS"; $connectionInfo = array( "Database"=>"AuServer",