Update of /cvsroot/openfirst/base/config
In directory sc8-pr-cvs1:/tmp/cvs-serv17367
Modified Files:
dbase.php first.php
Log Message:
Add ODBC functionality
Index: dbase.php
===================================================================
RCS file: /cvsroot/openfirst/base/config/dbase.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** dbase.php 24 Aug 2003 15:01:12 -0000 1.7
--- dbase.php 24 Aug 2003 18:51:04 -0000 1.8
***************
*** 52,55 ****
--- 52,64 ----
}
return(mssql_connect($server, $username, $password));
+ } elseif ($dbasetype == "odbc") {
+ if(function_exists("odbc_connect") == false) {
+ die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type.");
+ }
+ if($newlink != "") {
+ return(odbc_connect($server, $username, $password, $newlink));
+ } else {
+ return(odbc_connect($server, $username, $password));
+ }
}
exit;
***************
*** 96,99 ****
--- 105,117 ----
}
return(0);
+ } elseif ($dbasetype == "odbc") {
+ if(function_exists("odbc_error") == false) {
+ die("ODBC support is not enabled in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type.");
+ }
+ if($linkidentifier != "") {
+ return(odbc_error($linkidentifier));
+ } else {
+ return(odbc_error());
+ }
}
exit;
***************
*** 116,119 ****
--- 134,146 ----
}
return(0);
+ } elseif ($dbasetype == "odbc") {
+ if(function_exists("odbc_errormsg") == false) {
+ die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type.");
+ }
+ if($linkidentifier != "") {
+ return(odbc_errormsg($linkidentifer));
+ } else {
+ return(odbc_errormsg());
+ }
}
exit;
***************
*** 142,150 ****
return(mssql_query($string));
}
}
exit(0);
}
! function ofirst_dbfetch_object($resource) {
global $dbasetype;
if($dbasetype == "mysql") {
--- 169,183 ----
return(mssql_query($string));
}
+ } elseif ($dbasetype == "odbc") {
+ if(function_exists("odbc_exec") == false) {
+ die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type.");
+ }
+ // Note: this may be misleading, the variable names are not reflective of their content in this particular line, as the odbc function uses an order different from the other databases.
+ return(odbc_exec($string, $linkidentifer));
}
exit(0);
}
! function ofirst_dbfetch_object($resource, $rownumber = "") {
global $dbasetype;
if($dbasetype == "mysql") {
***************
*** 158,161 ****
--- 191,203 ----
}
return(mssql_fetch_object($resource));
+ } elseif($dbasetype == "odbc") {
+ if(function_exists("odbc_fetch_object") == false) {
+ die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type.");
+ }
+ if($rownumber != "") {
+ return(odbc_fetch_object($resource, $rownumber));
+ } else {
+ return(odbc_fetch_object($resource));
+ }
}
***************
*** 175,180 ****
}
return(mssql_num_rows($resource));
}
-
exit(0);
}
--- 217,230 ----
}
return(mssql_num_rows($resource));
+ } elseif($dbasetype == "odbc") {
+ if(function_exists("odbc_num_rows") == false) {
+ die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type.");
+ }
+ if($resource != "") {
+ return(odbc_num_rows($resource));
+ } else {
+ return(odbc_num_rows());
+ }
}
exit(0);
}
Index: first.php
===================================================================
RCS file: /cvsroot/openfirst/base/config/first.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** first.php 24 Aug 2003 15:22:40 -0000 1.21
--- first.php 24 Aug 2003 18:51:04 -0000 1.22
***************
*** 206,209 ****
--- 206,210 ----
<option value="mysql" selected="selected">MySQL</option>
<option value="mssql">Microsoft SQL</option>
+ <option value="odbc">ODBC</option>
</select>
<tr><td>Title of Software</td><td><input type="text" name="title" value="openFIRST" /></td></tr>
|