Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUGE with MS SQL Server #852

Closed
sarojthapa60 opened this issue Mar 28, 2017 · 4 comments
Closed

HUGE with MS SQL Server #852

sarojthapa60 opened this issue Mar 28, 2017 · 4 comments

Comments

@sarojthapa60
Copy link

I looked at the REQUIREMENTS and it says MySQL. I have my users table in MS SQL Server and am thinking about using HUGE framework. Can I still use HUGE with MS SQL Server?

@panique
Copy link
Owner

panique commented Mar 28, 2017

Are you sure you want to use a framework on top of EXISTING data ? this is quite insane... It would probably be easier to simply use mysql like the autoinstaller does and import your users.

@sarojthapa60
Copy link
Author

Hi Panique, I am not trying to use a framework on top of existing data. What I am trying to do is create a login panel with reset and register options and link the user credentials to the table in a ms sql server database.
I was looking at your php-login-advanced repository. I think that's the one I need. Can I connect to the MS SQL Server database instead of MySql?

@jjkirkpatrick
Copy link
Contributor

Hi Sarojthapa, I also use Microsoft SQL due to existing infrastructure, what you will need to do it edit the DatabaseFactory.php file

in the getConnection function you have the options to connect to MySql these need to be changed,

$options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);

$connectionString = 'sqlsrv:Server=' . Config::get('DB_HOST_SQLSRV') . ';Database=' . Config::get('DB_NAME_SQLSRV');

$this->database = new PDO("$connectionString" , Config::get('DB_USER_SQLSRV'), Config::get('DB_PASS_SQLSRV'), $options);
`

That is what i use, don't forget however you will need to install the PHP_PDO_SQLSRV php extensions on your webserver

@sarojthapa60
Copy link
Author

Thank you so much oisian. I already have PHP_PDO_SQLSRV installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants