Post by haroon.tyagi » Tue Jul 09, 2024 7:15 pm

Hi,
I am trying to install Opencart 4 with MSSql Server. I have successfully installed the Opencart 4 with MSSql Server and after changing the query syntax, store login. But I have problem with admin login whenever I am trying to login in admin, its just redirect to login page again.

When i checked it in the details:
1. Admin login page load session login_token generated
2. But when click on Login button, $this->session->data['login_token'] undfined mean session lost. So after click on login button its just redirect to me login page


Please help me to give ideas and to fix the error so we have Opencart 4 with mssql server. thanks for everyone

Newbie

Posts

Joined
Sat Sep 15, 2018 11:35 am

Post by ADD Creative » Wed Jul 10, 2024 7:16 pm

Try changing session_engine to file in system/config/admin.php as a test.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by JNeuhoff » Wed Jul 10, 2024 8:17 pm

You haven't provided much details, such as the OpenCart version, etc. But in general, databases other than the MySQL/MariaDB won't work, not without a lot of modifications. Also, you shouldn't run OpenCart on a Windows server.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by haroon.tyagi » Sat Aug 31, 2024 2:40 pm

@ADD Creative, Dear I have changed session_engine to file in system/config/admin.php and its working fine. Thanks but needs to check in case of session_engine is db.

Right now i am doing testing and once done or any issue will update you.

@JNeuhoff, Dear Guru Sir, Please check the detail below:
Opencart Version: 4.0.2.3
Operating System: Window 11 64bit (testing)
Sql Server Version: Microsoft SQL Server 2014 - 12.0.2000.8 (X64)

Please give your suggestion/ idea will be very useful. You are right, we have to do lots of modification but if we do then finally we have the working opencart with mssql I am sure.

Newbie

Posts

Joined
Sat Sep 15, 2018 11:35 am

Post by ADD Creative » Mon Sep 02, 2024 5:00 pm

Sounds like you need to check your oc_session table is correct and the queries in system/library/session/db.php.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by JNeuhoff » Mon Sep 02, 2024 8:07 pm

It is especially worse in OpenCart 4.0.2.3, as opposed to 3.0.4.0, with regards to the support for databases other than MySQL, because it uses loads of unneeded backquotes for field names. You'll end up having to replace them all if you plan to use MSSQL:

In MySQL, that might be written:

Code: Select all

SELECT `select` FROM `from`;
In MS SQL Server, that might be written:

Code: Select all

SELECT [select] FROM [from];
This will probably be just the tip of the iceberg.

And you'll have to implement a MSSQL driver for OpenCart in the first place in the system/library/db.

As said before, OpenCart was only written for MySQL.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ActiveDuck » Mon Oct 07, 2024 12:24 pm

You're absolutely right! The excessive use of backquotes in OpenCart 4.0.2.3 makes it a nightmare when trying to work with anything other than MySQL. The need to manually replace them for MSSQL is a huge time sink. Plus, setting up a driver for MSSQL in the system is no small task. It really shows that OpenCart was designed with only MySQL in mind, making it far less flexible for developers who want to use other databases. It would be great if OpenCart could introduce better support for alternative databases in future versions.

Macy’s Insite


Newbie

Posts

Joined
Thu Oct 03, 2024 6:15 pm
Who is online

Users browsing this forum: No registered users and 1 guest