当前位置: 首页>>代码示例>>PHP>>正文


PHP odbc_exec函数代码示例

本文整理汇总了PHP中odbc_exec函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_exec函数的具体用法?PHP odbc_exec怎么用?PHP odbc_exec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了odbc_exec函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_json_data

 public function get_json_data()
 {
     $lista = json_decode($this->field_list);
     $base = $this->db->getDB();
     $this->conn = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ={$base}", '', '') or exit('Cannot open with driver.');
     if (!$this->conn) {
         exit("Connection Failed: " . $this->conn);
     }
     $rs = odbc_exec($this->conn, $this->sql);
     if (!$rs) {
         exit("Error in SQL");
     }
     $value = '[';
     while (odbc_fetch_row($rs)) {
         $value .= '[';
         foreach ($lista as $valor) {
             $value .= $this->not_null(odbc_result($rs, $valor[0]), $valor[1]) . ',';
         }
         $value .= '],';
     }
     $value .= ']';
     $value = str_replace(",]", "]", $value);
     odbc_close_all();
     //$value = utf8_encode($value);
     return $value;
 }
开发者ID:el486,项目名称:dipsoh-rt,代码行数:26,代码来源:class_lib.php

示例2: ImportData

function ImportData($objOdbc, $objMySql, $strTableName)
{
    global $objMySql;
    $objMySql->query("TRUNCATE `" . strtolower($strTableName) . '`;');
    $objResult = odbc_exec($objOdbc, "SELECT * FROM " . $strTableName . ";");
    print "Migrating " . odbc_num_rows($objResult) . " rows of data for " . $strTableName . "... [0]";
    $intCount = 0;
    while ($arrResult = odbc_fetch_array($objResult)) {
        print str_repeat(chr(8), strlen($intCount) + 1);
        $intCount++;
        print $intCount . ']';
        $strColumns = 'pkid';
        $strValues = 'NULL';
        foreach ($arrResult as $strKey => $strValue) {
            $strColumns .= ', `' . strtolower($strKey) . '`';
            if (strlen($strValue)) {
                $strValues .= ", '" . $objMySql->escape_string($strValue) . "'";
            } else {
                $strValues .= ', NULL';
            }
        }
        $strSql = sprintf('INSERT INTO `%s` VALUES (%s);', strtolower($strTableName), $strValues);
        $objMySql->query($strSql);
    }
    print " Done.\r\n";
}
开发者ID:alcf,项目名称:chms,代码行数:26,代码来源:acs-load-mysql.cli.php

示例3: InsereProduto

function InsereProduto($NomeProduto, $descProduto, $precProduto, $descontoProduto, $idCategoria, $ativoProduto, $idUsuario, $qtdMinEstoque)
{
    $con = odbc_connect("DRIVER={SQL Server}; SERVER=i9yueekhr9.database.windows.net;\n\t\tDATABASE=lotus;", "TSI", "SistemasInternet123");
    $SQL = "insert into produto(nomeProduto, descProduto, precProduto, descontoPromocao, idCategoria, ativoProduto, idUsuario, qtdMinEstoque, imagem)\n\t\tvalues('" . $NomeProduto . "', '" . $descProduto . "', " . $precProduto . ", \n\t\t\t" . $descontoProduto . ", " . $idCategoria . ", " . $ativoProduto . ", " . $idUsuario . ", " . $qtdMinEstoque . ",  null)";
    odbc_exec($con, $SQL);
    echo "PRODUTO INSERIDO COM SUCESSO";
}
开发者ID:paiol4,项目名称:PI2ndSem,代码行数:7,代码来源:CadProd2.php

示例4: SaveNewAccount

 public function SaveNewAccount($db)
 {
     $query = "insert into tblMember(Fc_Fullname,Fc_Gender,Fc_Email,Fc_Bday,Fc_Password,Fc_PhotoLink)\n\t\t\t\t\tVALUES('" . $this->fullname . "','" . $this->sex . "','" . $this->email . "'\n\t\t\t\t\t\t,'" . $this->bday . "','" . $this->pass . "','default.jpg')";
     if (odbc_exec($db, $query)) {
         return true;
     }
 }
开发者ID:vincentnacar02,项目名称:Quicktrail-socialApp,代码行数:7,代码来源:CreateAccount.php

示例5: exec

 public function exec($query, $security = NULL)
 {
     if (empty($query)) {
         return false;
     }
     return odbc_exec($this->connect, $query);
 }
开发者ID:znframework,项目名称:znframework,代码行数:7,代码来源:Odbc.php

示例6: db

 public function db($query)
 {
     $connect = odbc_connect("SIT", "palagi01", "s1mple01");
     $result = odbc_exec($connect, $query);
     return $result;
     #odbc_close($connect);
 }
开发者ID:agansiv,项目名称:DI_Test,代码行数:7,代码来源:db_connect.php

示例7: sql_result

function sql_result($query, $conn = NULL)
{
    if (DATABASE == "mysql") {
        if (is_null($conn)) {
            $qryRslt = @mysql_query($query, $GLOBALS["db_con"]);
        } else {
            $qryRslt = @mysql_query($query, $conn);
        }
        if (!$qryRslt) {
            echo $query;
            error_log(date("F j, Y, g:i a") . "\t{$query}\n" . $_SERVER["PATH_INFO"] . "\n\t" . @mysql_error() . "\n\n", 3, "sql_error.log");
            die("<br><font color=\"red\">Due to some technical problem, your Transaction was <b>NOT</b> successful</font>\n");
        }
        return $qryRslt;
    } else {
        if (DATABASE == "odbc") {
            if (is_null($conn)) {
                $qryRslt = @odbc_exec($GLOBALS["db_con"], $query);
            } else {
                $qryRslt = @odbc_exec($conn, $query);
            }
            if (!$qryRslt) {
                error_log(date("F j, Y, g:i a") . "\t{$query}\n" . $_SERVER["PATH_INFO"] . "\n\t" . @odbc_error() . "\n\n", 3, "sql_error.log");
                die("<br><font color=\"red\">Due to some technical problem, your Transaction was <b>NOT</b> successful</font>\n");
            }
            return $qryRslt;
        }
    }
}
开发者ID:rugbyprof,项目名称:visitme,代码行数:29,代码来源:sqlfunctions.php

示例8: execute

 /**
  *
  * @param type $query
  * @param type $type
  * @return type
  */
 public function execute($query, $type = null)
 {
     $result = array();
     switch ($this->db_engine) {
         case "pgsql":
             $resultado = pg_query($this->conn, $query);
             while ($row = pg_fetch_row($resultado)) {
                 $result[] = $row;
             }
             pg_close($this->conn);
             break;
         case "mssql":
             $resultado = odbc_exec($this->conn, $query);
             while ($row = odbc_fetch_array($resultado)) {
                 $result[] = $row;
             }
             break;
         case "mysql":
             $result = array();
             $resultado = mysql_query($query);
             if (gettype($resultado) == "boolean") {
                 $result = $resultado;
             } else {
                 while ($row = mysql_fetch_row($resultado)) {
                     $result[] = $row;
                 }
             }
             mysql_close($this->conn);
             break;
     }
     return $result;
 }
开发者ID:emildev35,项目名称:distribuidos,代码行数:38,代码来源:Conexion.php

示例9: 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

示例10: doquery

function doquery($query, $table, $fetch = false)
{
    global $link, $debug, $ugamela_root_path;
    @(include $ugamela_root_path . 'config.php');
    if (!$link) {
        $link = odbc_connect($dbsettings["server"], $dbsettings["user"], $dbsettings["pass"]) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
        //message(mysql_error()."<br />$query","SQL Error");
        odbc_select_db($dbsettings["name"]) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
    }
    // por el momento $query se mostrara
    // pero luego solo se vera en modo debug
    $sqlquery = odbc_exec($query, str_replace("{{table}}", $dbsettings["prefix"] . $table)) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
    //message(mysql_error()."<br />$query","SQL Error");
    unset($dbsettings);
    //se borra la array para liberar algo de memoria
    global $numqueries, $debug;
    //,$depurerwrote003;
    $numqueries++;
    //$depurerwrote003 .= ;
    $debug->add("<tr><th>Query {$numqueries}: </th><th>{$query}</th><th>{$table}</th><th>{$fetch}</th></tr>");
    if ($fetch) {
        //hace el fetch y regresa $sqlrow
        $sqlrow = odbc_fetch_array($sqlquery);
        return $sqlrow;
    } else {
        //devuelve el $sqlquery ("sin fetch")
        return $sqlquery;
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:29,代码来源:odbc.php

示例11: ExecSQL

 function ExecSQL($sql)
 {
     //                echo "ExecSQL" . $sql  . "<br>" ;
     $res = odbc_exec($this->sce, $sql);
     //                if (! $res) echo "Bad Exec SQL " . htmlspecialchars($sql) . "<br>" ; //zzzzz
     return $res ? true : false;
 }
开发者ID:renozaf,项目名称:health_data_viz,代码行数:7,代码来源:dbodbcconn.class.php

示例12: 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

示例13: query

 /**
  * Enter description here...
  *
  * @param unknown_type $query
  *
  * @return unknown
  */
 public static function query($query)
 {
     if (!($var = \odbc_exec(self::$conn, $query))) {
         throw new DBException('(' . $query . ') had an error: ' . \odbc_errormsg());
     }
     return $var;
 }
开发者ID:johsbk,项目名称:penguin,代码行数:14,代码来源:ODBC.php

示例14: Query

 public function Query($sql)
 {
     $rs = odbc_exec($this->db_link, $sql);
     while ($row = odbc_fetch_array($rs)) {
         $rows[] = $row;
     }
     return $rows;
 }
开发者ID:jeann2013,项目名称:observatorio,代码行数:8,代码来源:class.odbc.php

示例15: DBODBCRows

 function DBODBCRows($conn, $sql)
 {
     $this->res = odbc_exec($conn, $sql);
     if (!$this->res) {
         echo "zzz Bad DBODBCRows with SQL:" . $sql;
     }
     //echo "zzz SQL:" . $sql ;//zzz
 }
开发者ID:renozaf,项目名称:health_data_viz,代码行数:8,代码来源:dbodbcrows.class.php


注:本文中的odbc_exec函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。