Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: can this work with MSSQL  (Read 6085 times)

0 Members and 1 Guest are viewing this topic.

RevoD

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
can this work with MSSQL
« on: August 17, 2004, 04:31:10 am »

my clients server runs MSSQL, can I still use this script with this type of database management on a windows server?
« Last Edit: February 17, 2006, 06:43:27 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: can this work with MSSQL
« Reply #1 on: August 17, 2004, 07:21:55 am »

without modification of coppermine core code: no. There have been plans on database abstraction, but so far they only exist in some developer's minds. Coppermine works currently only with mySQL.

GauGau
Logged

radianation

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 79
    • Radianation
Re: can this work with MSSQL
« Reply #2 on: August 20, 2004, 06:59:07 am »

What exactly needs to be changed in order for it to work with MSSQL? An idea of the scope would be enough. Thanks.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: can this work with MSSQL
« Reply #3 on: August 20, 2004, 07:40:16 am »

no idea, I have never worked with mssql. Inside the main function declaration of coppermine there's the connection function (there is a slight degree of db abstarction in coppermine). You might want to take a look at include/functions.inc.php, find
Code: [Select]
/**************************************************************************
   Database functions
 **************************************************************************/

// Connect to the database
function cpg_db_connect()
{
        global $CONFIG;
        $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
        if (!$result)
                return false;
        if (!mysql_select_db($CONFIG['dbname']))
                return false;
        return $result;
}

// Perform a database query
function db_query($query, $link_id = 0)
{
        global $CONFIG, $query_stats, $queries;

        $query_start = cpgGetMicroTime();
        if (($link_id)) {
            $result = mysql_query($query, $link_id);
        } else {
                $result = mysql_query($query);
        }
        $query_end = cpgGetMicroTime();
        if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
                $query_stats[] = $query_end - $query_start;
                $queries[] = $query;
        }
        if (!$result) db_error("While executing query \"$query\" on $link_id");

        return $result;
}

// Error message if a query failed
function db_error($the_error)
{
        global $CONFIG;

        if (!$CONFIG['debug_mode']) {
            cpg_die(CRITICAL_ERROR, 'There was an error while processing a database query', __FILE__, __LINE__);
        } else {

                $the_error .= "\n\nmySQL error: ".mysql_error()."\n";

                $out = "<br />There was an error while processing a database query.<br /><br/>
                    <form name='mysql'><textarea rows=\"8\" cols=\"60\">".htmlspecialchars($the_error)."</textarea></form>";

            cpg_die(CRITICAL_ERROR, $out, __FILE__, __LINE__);
        }
}

// Fetch all rows in an array
function db_fetch_rowset($result)
{
        $rowset = array();

        while ($row = mysql_fetch_array($result)) $rowset[] = $row;

        return $rowset;
}
Maybe it already works if you change those lines to work with mssql, but if it doesn't I'm afraid you will have to look into nearly every file, as they do the actual queries.

GauGau
Logged

Goatie

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: can this work with MSSQL
« Reply #4 on: February 17, 2006, 11:54:48 am »

Just wondered if any advance had been made in cpg1.4 in regard to database type abstraction or indeed whether or not MSSQL is now supported?
Logged

Nibbler

  • Guest
Re: can this work with MSSQL
« Reply #5 on: February 17, 2006, 12:11:49 pm »

Please don't ask about 1.4 on the 1.3 support board. There is no support for mssql in 1.4
Logged

Goatie

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: can this work with MSSQL
« Reply #6 on: February 17, 2006, 03:36:47 pm »

My Apologies. Just didn't see the point in starting a new thread based on an existing topic.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 15 queries.