gwolgamott Posted May 17, 2010 Share Posted May 17, 2010 Ok I'm new to Microsoft's world of crap... So is there an easy way or at least recommendations for me to get connected to an MS SQL server? I have access to the server it is on to make changes as I want & have lost the nerve of dealing with microsoft languages since I am not a MS guy and I need the comfort of PHP back. So I've read some on ODBC but seriously it seems like all that is written by people talking microsoft speak... Any links, help, pointers, or just plain "Look idiot do this" out there to help me try to figure this out? SIDE-NOTE: Not sure if this is appropriate area to ask this, if not please move it for me thanks! Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/ Share on other sites More sharing options...
Sudantha Posted May 17, 2010 Share Posted May 17, 2010 1. Install a SQL server instant or run a one 2.Configure php.ini in extensions uncomment mssql.dll 3.use mssql function (same as mysql function refer to php doc ) Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1059652 Share on other sites More sharing options...
gwolgamott Posted May 17, 2010 Author Share Posted May 17, 2010 seriously that easy? OK now I feel like an idiot... One question though, what if the mssql is on a seperate windows server then the web server Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1059676 Share on other sites More sharing options...
Brian Swan Posted May 17, 2010 Share Posted May 17, 2010 You might want to consider using the PHP driver (sqlsrv) released by Microsoft. There is more information about the difference between the mssql and the sqlsrv divers here: http://blogs.msdn.com/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx. If you choose to go that route, this might be helpful for getting set up: http://blogs.msdn.com/brian_swan/archive/2010/02/08/getting-started-with-the-sql-server-driver-for-php.aspx. To your last question, you shouldn't have any problems with the web server and database server being on different machines as long as your database server is configured to allow remote connections. Hope that helps. -Brian Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1059715 Share on other sites More sharing options...
gwolgamott Posted May 17, 2010 Author Share Posted May 17, 2010 You might want to consider using the PHP driver (sqlsrv) released by Microsoft. There is more information about the difference between the mssql and the sqlsrv divers here: http://blogs.msdn.com/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx. If you choose to go that route, this might be helpful for getting set up: http://blogs.msdn.com/brian_swan/archive/2010/02/08/getting-started-with-the-sql-server-driver-for-php.aspx. To your last question, you shouldn't have any problems with the web server and database server being on different machines as long as your database server is configured to allow remote connections. Hope that helps. -Brian Using the sqlsrv option seems like a good choice, so programmically do I still use the mssql() function in my php scripts EDIT: And Nevermind didn't read your second blog there at first that already answer my questions. Thanks to Both of you Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1059733 Share on other sites More sharing options...
gwolgamott Posted May 18, 2010 Author Share Posted May 18, 2010 I do not express right? I have Microsoft server installed here already by someone else, I've access to the server so I'd just need to apply the driver to the server, seriously I'm an idiot with MS technology I'm an linux server guy... feel so lost. Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1060030 Share on other sites More sharing options...
Brian Swan Posted May 18, 2010 Share Posted May 18, 2010 Not sure I understand your last question. If you install the sqlsrv driver just like you would any other PHP extension (put the .dll in the extension directory, add extension=php_sqlsrv.dll to your php.ini file, then restart your web server), the driver should be loaded and ready to use. Is that what you were asking? -Brian Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1060147 Share on other sites More sharing options...
gwolgamott Posted May 18, 2010 Author Share Posted May 18, 2010 Sorry, meant in reference to your blog on: Getting Started with the SQL Server Driver for PHP. I can use the same example on SQL Server 2008 and not just SQL server express, that is the question. Here's my scenario though. I've a web server running IIS with sharepoint and a third party software for an erp system that uses it. Well their VB-webpart thing is so limited that I can't do much with it, and what I want to do is simple in php so I want to connect to the SQL Server that I have priviledges too on a seperate machine. So I want to install php on iis7 and then try to connect to the database. Within in intranet and if possible using windows authentication/AD... I'm limited knowlegde though with microsoft networking, you know just enough to get me in trouble, but I have an awesome administrator to help me not break stuff if I get set in the right direction. Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1060188 Share on other sites More sharing options...
Brian Swan Posted May 18, 2010 Share Posted May 18, 2010 Ah...I see. You can use any version of SQL Server...I just used SQL Express becuase I figured most folks would be interested in the free version. It sounds to me like you should be able to use Windows Authentication in your scenario. More info here: http://msdn.microsoft.com/en-us/library/cc296198(SQL.90).aspx Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1060258 Share on other sites More sharing options...
Brian Swan Posted May 18, 2010 Share Posted May 18, 2010 OH! This might come in handy too: http://blogs.msdn.com/brian_swan/archive/2010/02/10/sql-server-driver-for-php-understanding-windows-authentication.aspx Hope that helps. -Brian Quote Link to comment https://forums.phpfreaks.com/topic/202076-using-ms-sql-php/#findComment-1060259 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.