Jump to content
#StayAtHome ×

Archived

This topic is now archived and is closed to further replies.

gwolgamott

Using MS SQL & PHP

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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 )

 

:D

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.