Tag: php

SQL server transactions in PHP

I’m trying to grasp the idea of transactions fully. Therefore the following question… (ofcourse newbie, so don’t laugh 😀 ) I have set up a (simplified) transaction in PHP (using the PHP SQL driver from microsoft). I want to get the rows I’m going to delete for some extra processing later: sqlsrv_begin_transaction($conn); $sql = “SELECT […]

Headache getting php and sql server 2005 to run together

Below is the code that i cannot get to work. I know i have established a connection to the database but this returns nothing. What am i doing wrong? $result = “SELECT * FROM images WHERE path = ?”; $params = array(“blah”); $row = sqlsrv_query($conn, $result, $params); $finished = sqlsrv_fetch_array($row); if($finished) { echo “blach”; }

“infinite” sql statement?

I’ve got a very strange sql-related problem. I’m accessing a MSSQL Server 2005 with PHP (odbc), when I profile the sql statement the following is executed: declare @p1 int set @p1=180150003 declare @p3 int set @p3=2 declare @p4 int set @p4=1 declare @p5 int set @p5=-1 exec sp_cursoropen @p1 output,N’SELECT fieldA, fieldB, fieldC, fieldD, fieldE […]

IIS 7 PHP Unable to load dynamic library

I installed PHP and PHP Manager on my IIS machine through the web installer thing. I can run a web page with php in it fine, but it wont load libraries correctly. I want to connect to an MS SQL database, so i got the dll and put it in the ext folder but it […]

sqlsrv_connect() not found

I’m working on a project that uses the SQL Server Driver for PHP, and want to upgrade the driver to the new version (2.0), because I need some of the functions that have been implemented there. I replaced the old .dll in the php/ext directory and restarted the web server. But now I receive the […]

PHP Apache SQL Server production environment on OS X

I have a client who wants me to build a site using PHP and SQL Server. Problem is I do all my PHP development in OS X running Apache. I have one machine running Windows with an SQL Server production environment but I can’t seem to connect via “sqlsrv_connect” because I can’t install the drivers […]

extension=php_mssql.dll – error load

I am configuring a server IIS7 to work with php and mssql in php.ini and when I try to call the “extension = php_mssql.dll” appears to me an error when I refresh the site. “500 – Internal server error. There is a problem with the resource you are looking for, and it can not be […]

How to use PHP's odbc_connect() to connect to an ODBC DSN on another host on the same LAN?

I’ve successfully tested a connection via PHP’s odbc_connect() to a SQL Server 2005 Express database on a Windows Vista box using the following code: $connect = odbc_connect(“mssqllocal2”, “”, “”); // first arg is the System DSN that I configured on Windows This connection works fine when executed from an instance of WAMPserver on the same […]

Updating record in Database

I have this form on my site where a user can enter many strings and save it to their account. But I’m not sure how to go about it. Instead of creating a whole new user, with new values, I’d just like to update a single entry in the database. For example if a user […]

PHP ORM with support for SQL Server 2005

I have been looking around the current options (and related SO questions) regarding PHP ORM solutions, however I have a couple of unique requirements: I am running PHP on Windows Server 2003 I need to interface with SQL Server 2005 I can’t seem to find a simple answer from the PHP ORM solutions out there […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.