Locking a SQL Server Database with PHP *

Question

I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server?

Edit on question:

The query is failing silently with no errors messages logged, and does not occur inside of a transaction.

Final Solution:

I never was able to solve the problem, however what I wound up doing was switching to MySQL and using a transactional level query here. This was not the main or even a primary reason to switch. I had been having problems with SQL Server and it allowed me to have our CMS and various other tools all running on the same database. Previous we had a SQL Server and a MySQL database running to run our site. The port was a bit on the time consuming however in the long run I feel it will work much better for the site and the business.

Answer

I suppose you have three options.

  1. Set user permissions so that user x can only read from the database.

  2. Set the database into single user mode so only one connection can access it

    sp_dboption 'myDataBaseName', single, true

  3. Set the database to readonly

    sp_dboption 'myDataBaseName', read only, true

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/5025/" >Locking a SQL Server Database with PHP< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment