Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Connecting to a MS SQL 2008 database?


onedownfiveup

Recommended Posts

I'm having trouble with os commerce connecting with a MS SQL 2008 database. Will it work with this database? It won't connect to the supplied database hostname I was given. I have sent an email to help desk and am waiting on a reply.

 

php does support connecting to a ms sql database. but osc is written to expect an mysql database.

 

in order to get it to work, you'd have to change the catalog/includes/functions/database.php and the catalog/admin/includes/database.php functions so that they use ms sql. also, i've noticed that the sql syntax is slightly different between mysql and mssql. at the very least, you would have to change every insert that uses the 'set' syntax, as opposed to the parenthetical lists of columns and values. osc also makes heavy use of auto_increment columns. the mechanism for retrieving the value of the added column is very different in mssql - you have to make another query to the database to get the value. there may be other syntax that doesn't work, like anything that is altering tables or querying database schema.

 

it will be a lot of work, not to mention a lot of testing to ensure proper behavior. if you're not adept at php and sql, i'd suggest using mysql rather than trying to get osc to work with mssql.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...