本文整理汇总了PHP中odbc_close函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_close函数的具体用法?PHP odbc_close怎么用?PHP odbc_close使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了odbc_close函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: changeUserPassword
public function changeUserPassword($userName, $userOldPassword, $userNewPassword, $portalID)
{
VDSN;
$conn = odbc_connect(VDSN, USER, PW) or die('ODBC Error:: ' . odbc_error() . ' :: ' . odbc_errormsg() . ' :: ' . VDSN);
//test for user name
if ($conn) {
$sql = "SELECT '1' outputFlag FROM Portal_User WHERE User_Name = '" . $userName . "' AND Portal_ID = '" . $portalID . "'";
$rs = odbc_exec($conn, $sql);
$row = odbc_fetch_row($rs);
if ($row == null) {
odbc_close($conn);
return "You have entered an invalid user name; please try again.";
}
}
//test for password
if ($conn) {
$sql = "SELECT '1' FROM Users WHERE User_Name = '" . $userName . "' AND User_Password = '" . $userOldPassword . "'";
$rs = odbc_exec($conn, $sql);
$row = odbc_fetch_row($rs);
if ($row == null) {
odbc_close($conn);
return "You have entered an invalid password for your account; please try again.";
}
}
//save new password
if ($conn) {
$sql = "UPDATE Users SET User_Password = '" . $userNewPassword . "' WHERE User_Name = '" . $userName . "'";
$rs = odbc_exec($conn, $sql);
}
return "OK";
}
开发者ID:nemac,项目名称:flash-fcav,代码行数:31,代码来源:NEMAC_MapViewer_queries.php
示例2: sql_close
function sql_close()
{
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
if ($this->db_connect_id) {
if ($this->query_result) {
@odbc_free_result($this->query_result);
}
$result = @odbc_close($this->db_connect_id);
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$this->sql_time += $endtime - $starttime;
return $result;
} else {
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$this->sql_time += $endtime - $starttime;
return false;
}
}
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:26,代码来源:db2.php
示例3: updateSF
/**
* PHP Template.
*/
function updateSF($tableName, $rowID, $sfID)
{
$odbc = odbcConnect();
$stmt = odbc_prepare($odbc, "INSERT into SalesForceUpdateQueue (creationDate, mysqlTableName, mysqlRowID, salesForceID) VALUES(CURRENT_TIMESTAMP(), ?, ?, ?)");
$rs = odbc_execute($stmt, array($tableName, $rowID, $sfID));
odbc_close($odbc);
}
开发者ID:mainakbiswas,项目名称:openqwaq,代码行数:10,代码来源:SFUpdateDB.php
示例4: sql_close
function sql_close()
{
if($this->db_connect_id)
{
if( $this->in_transaction )
{
@odbc_commit($this->db_connect_id);
}
if( count($this->result_rowset) )
{
unset($this->result_rowset);
unset($this->field_names);
unset($this->field_types);
unset($this->num_rows);
unset($this->current_row);
}
return @odbc_close($this->db_connect_id);
}
else
{
return false;
}
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:25,代码来源:mssql-odbc.php
示例5: head_cus
function head_cus($customer_no)
{
$link = Fconectar();
if ($link) {
// Se define la consulta que va a ejecutarse, como en sql
$sql_datos_cus = "\n\t\t\t\t\tSELECT C.par_cus_no, C.cus_no, C.cus_name, V1.slspsn_name AS Vendedor, V2.slspsn_name AS Cobrador, C.ar_terms_cd \n\t\t\t\t\tFROM\n\t\t\t\t\tARCUSFIL_SQL AS C,\n\t\t\t\t\tARSLMFIL_SQL AS V1,\n\t\t\t\t\tARSLMFIL_SQL AS V2\n\t\t\t\t\tWHERE\n\t\t\t\t\tC.slspsn_no = V1.slspsn_no AND\n\t\t\t\t\tC.collector = V2.slspsn_no AND\n\t\t\t\t\tC.cus_no = '{$customer_no}'\n\t\t\t\t";
// Se ejecuta la consulta y se guardan los resultados
$results = odbc_exec($link, $sql_datos_cus) or die("Error en instruccion SQL {$sql_datos_cus}");
$existe = odbc_num_rows($results);
if ($existe) {
$registro = odbc_fetch_array($results);
$head_cus_no = $registro['cus_no'];
$head_cus_name = $registro['cus_name'];
$head_ar_terms_cd = $registro['ar_terms_cd'];
$head_slspsn_name = $registro['Vendedor'];
$head_collector = $registro['Cobrador'];
} else {
$mensaje = "No existen registros!";
}
} else {
Ferror("No se pudo establecer coneccion con la Base de Datos!");
}
// Se cierra la conexión
odbc_close($link);
echo "\n\t\t<div align='center'>\n\t\t<table width='40%' border='3' cellpadding='0' cellspacing='10' bordercolor='#DCF3A4' align='center'>\n\t\t\t<th colspan='2'>EDADES DE CARTERA POR CLIENTE (Datos hasta: " . date('d-m-Y') . ")</th>\t\n\t\t\t<tr>\n\t\t\t\t<td>Cliente:</td>\n\t\t\t\t<td>(" . number_format($head_cus_no, 0, '', '') . ") - {$head_cus_name}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Vendedor:</td>\n\t\t\t\t<td>{$head_slspsn_name}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Cobrador:</td>\n\t\t\t\t<td>{$head_collector}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Condición de Pago:</td>\n\t\t\t\t<td>{$head_ar_terms_cd}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='2' align='center'>Generado: " . date('d-m-Y H:i:s') . "</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</div>\n\t\t";
}
开发者ID:KatherinAguilera,项目名称:ProtisaReportes,代码行数:26,代码来源:age_cxc_cus+-+copia.php
示例6: sql_close
function sql_close()
{
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
if ($this->db_connect_id) {
if ($this->in_transaction) {
@odbc_commit($this->db_connect_id);
}
if (count($this->result_rowset)) {
unset($this->result_rowset);
unset($this->field_names);
unset($this->field_types);
unset($this->num_rows);
unset($this->current_row);
}
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$this->sql_time += $endtime - $starttime;
return @odbc_close($this->db_connect_id);
} else {
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$this->sql_time += $endtime - $starttime;
return false;
}
}
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:32,代码来源:msaccess.php
示例7: db_close
function db_close($conn)
{
if (odbc_close($conn)) {
return true;
} else {
return false;
}
}
开发者ID:ricardoletelier,项目名称:conexion-mysqli-postgresql-desde-php,代码行数:8,代码来源:odbc.php
示例8: close
public function close()
{
$this->transactionDepth = 0;
$this->transactionRolledBack = false;
if ($this->conn !== false) {
$cn = $this->conn;
$this->conn = false;
odbc_close($cn);
}
}
开发者ID:roncemer,项目名称:pfmgr2,代码行数:10,代码来源:SQLServerConnection.class.php
示例9: Disconnect
/**
* @return bool
*/
function Disconnect()
{
if ($this->_conectionHandle) {
$this->FreeResult();
@odbc_close($this->_conectionHandle);
$this->_conectionHandle = null;
return true;
} else {
return false;
}
}
开发者ID:JDevelopers,项目名称:Mail,代码行数:14,代码来源:odbc.php
示例10: __destruct
public function __destruct()
{
if ($this->activeTransaction) {
if ($this->autoCommit) {
$this->transactionCommit();
} else {
$this->transactionRollback();
}
}
@odbc_close($this->connection);
}
开发者ID:palmic,项目名称:lbox,代码行数:11,代码来源:class.DbOdbc.php
示例11: sql_close
function sql_close()
{
if ($this->db_connect_id) {
if ($this->query_result) {
@odbc_free_result($this->query_result);
}
$result = @odbc_close($this->db_connect_id);
return $result;
} else {
return false;
}
}
开发者ID:nmpetkov,项目名称:ZphpBB2,代码行数:12,代码来源:db2.php
示例12: index
public function index()
{
//test the dynamic connection with other databases seems successfull
$systems = System::all();
$res = [];
foreach ($systems as $system) {
$query = "SELECT [states].eq_id, [states].time, [states].[state_OK],[states].[state_MaintRQ], [states].[state_InMaint], [states].[state_Fault], [equipment].eq_id, CAST(CAST([equipment].eq_name AS VARBINARY) AS VARCHAR) as eq_name FROM [states] LEFT JOIN [equipment] on states.eq_id = [equipment].eq_id";
if ($system['dbversion'] == '2000') {
$port = '1434';
try {
$connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=" . $system['host'] . "," . $port . ";Database=" . $system['dbname'], $system['dbuser'], Crypt::decrypt($system['dbuserpass']));
} catch (ErrorException $e) {
$system->status = 'default';
$system->save();
$res[$system['name']] = ['error' => $e];
}
if ($conn) {
$results = odbc_exec($connection, $query);
$realData = [];
$i = 0;
while ($row = json_decode(json_encode(odbc_fetch_object($results)), true)) {
foreach ($row as $key => $item) {
if ($key == "eq_name" && is_string($item)) {
$row[$key] = iconv('UCS-2LE', 'UTF-8', $item);
}
}
$realData[$i] = $row;
$i++;
}
$res[$system['name']] = $realData;
odbc_free_result($results);
odbc_close($connection);
}
} else {
try {
$conn = new PDO("sqlsrv:Server=" . $system['host'] . ";Database=" . $system['dbname'], $system['dbuser'], Crypt::decrypt($system['dbuserpass']));
} catch (PDOException $e) {
$system->status = 'default';
$system->save();
$res[$system['name']] = ['error' => $e];
}
if ($conn) {
$sql = $conn->prepare($query);
$sql->execute();
$res[$system['name']] = $sql->fetchAll();
$conn = null;
}
}
}
return $res;
}
开发者ID:rvmladenov,项目名称:monitoring_system,代码行数:51,代码来源:TestController.php
示例13: db_close
function db_close($link = NULL)
{
db_link(false);
/* close db link */
switch (DATABASE) {
case 'mysql':
return mysql_close($link);
case 'mysqli':
return mysqli_close($link);
case 'sqlserver':
odbc_close($link);
return false;
}
}
开发者ID:ahmedandroid1980,项目名称:appgini,代码行数:14,代码来源:db.php
示例14: odbc_fila
function odbc_fila($sql, $fila)
{
$cnn_odbc = odbc_connect("ctw", "", "");
$rs = odbc_exec($cnn_odbc, $sql);
$value = "NO_EXISTE";
$value = odbc_fetch_array($rs, 1);
odbc_free_result($rs);
odbc_close($cnn_odbc);
//if(!$rs){
// return odbc_error($rs);
//} else {
return $value[$fila];
//}
}
开发者ID:Cywaithaka,项目名称:S.A.F.E.-Open-Source-Microfinance-Suite,代码行数:14,代码来源:compacw.inc.php
示例15: Disconnect
/**
* @return bool
*/
function Disconnect()
{
if ($this->_conectionHandle) {
if ($this->_resultId) {
@odbc_free_result($this->_resultId);
$this->_resultId = null;
}
@odbc_close($this->_conectionHandle);
$this->_conectionHandle = null;
return true;
} else {
return false;
}
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:17,代码来源:class_dbodbc.php
示例16: checkAlreadyId
function checkAlreadyId($conn, $sql)
{
$rs = odbc_exec($conn, $sql);
if (!$rs) {
exit("Error in SQL");
} else {
$num = odbc_fetch_row($rs);
if ($num) {
return "Already-Id";
} else {
return "Empty-Id";
}
}
odbc_close($conn);
}
开发者ID:nong053,项目名称:durbell-app-sync,代码行数:15,代码来源:config.php
示例17: db_query
function db_query($db_name, $sql, $bypass_admin_security, $debug_mode)
{
$sql = str_replace("#", "", $sql);
// basic protection against sql injections
// $bypass_admin_security = "yes" when an user is self-registering.
// This is the only case where a non-identified user can write to the database
// $debug_mode = "yes" shows the sql statement
if ($debug_mode == "yes") {
echo "<hr>-- Debug info--<br>" . $sql . "<hr>";
}
global $db_connection_type, $db_server_address, $db_user, $db_password;
$result = false;
switch ($db_connection_type) {
case "odbc":
$db_connection = odbc_connect($db_name, $db_user, $db_password);
if (substr($sql, 0, 6) == "SELECT" || substr($sql, 0, 12) == "SHOW COLUMNS" || $bypass_admin_security == "yes") {
$result = odbc_exec($db_connection, $sql);
} else {
if (isset($_COOKIE["bookings_profile_id"]) && intval($_COOKIE["bookings_profile_id"]) > 1) {
odbc_exec($db_connection, $sql);
$result = true;
}
}
odbc_close($db_connection);
break;
case "mysql":
$db_connection = mysql_connect($db_server_address, $db_user, $db_password);
mysql_set_charset("utf8", $db_connection);
mysql_select_db($db_name, $db_connection);
if (substr($sql, 0, 6) == "SELECT" || substr($sql, 0, 12) == "SHOW COLUMNS" || $bypass_admin_security == "yes") {
$result = mysql_query($sql);
} else {
if (isset($_COOKIE["bookings_user_id"])) {
$bookings_user_id = checkVar("sql", $_COOKIE["bookings_user_id"], "int", "", "", "0", "");
if ($bookings_user_id) {
$sql = "SELECT profile_id FROM rs_data_users WHERE user_id = " . $bookings_user_id . ";";
$temp = mysql_query($sql);
$profile_id = ($temp_ = mysql_fetch_array($temp)) ? $temp_["profile_id"] : 0;
if ($profile_id > 1) {
$result = mysql_query($sql);
}
}
}
}
mysql_close($db_connection);
}
return $result;
}
开发者ID:edhrtiw,项目名称:openbookings-dot-org,代码行数:48,代码来源:connect_db.php
示例18: ClosedDBConnection
function ClosedDBConnection($cn)
{
global $dbtype;
if ($dbtype == 'odbc') {
odbc_close($cn);
} else {
if ($dbtype == 'mssql') {
mssql_close($cn);
} else {
if ($dbtype == 'mysqli') {
mysqli_close($cn);
} else {
mysql_close();
}
}
}
}
开发者ID:Allvee,项目名称:Softswitch,代码行数:17,代码来源:common.php
示例19: disconnect
public function disconnect($cndriver = "mysql")
{
if ($cndriver == "mysql") {
if ($this->con) {
if (@mysql_close()) {
$this->con = false;
return true;
} else {
return false;
}
}
} elseif ($cndriver == "psql") {
$this->con = false;
pg_close($this->myconn);
} else {
$this->con = false;
odbc_close($this->myconn);
}
}
开发者ID:arsan-irianto,项目名称:apdpln,代码行数:19,代码来源:PHPJasperXML2.inc.php
示例20: Execute
function Execute($query)
{
/*#$sql= "SELECT * FROM MMET_DISK_IMG";
$this->o_con = mssql_connect ($this->server, $this->user_id, $this->user_pwd);
mssql_select_db ($this->database, $this->o_con);
#echo "query : $query <br>";
$rs= mssql_query ($query, $this->o_con);
#echo "The field number one is: ";
#echo mssql_result ($rs, 0, 0);
mssql_close ($this->o_con);*/
$this->o_con = odbc_connect($this->database, $this->user_id, $this->user_pwd);
$this->error = 0;
$this->result = odbc_exec($this->o_con, $query) or $this->error = 1;
if ($this->error == 1) {
$this->err_no = -1;
$this->err_msg = "";
}
odbc_close($this->o_con) or $this->error = 1;
}
开发者ID:akswosn,项目名称:tossi,代码行数:20,代码来源:clsMsSql.php
注:本文中的odbc_close函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论