• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tep_db_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link};
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        error_log('QUERY: ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    $result = mysqli_query(${$link}, $query) or tep_db_error($query, mysqli_errno(${$link}), mysqli_error(${$link}));
    return $result;
}
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:9,代码来源:database.php


示例2: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link}, $logger;
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        if (!is_object($logger)) {
            $logger = new logger();
        }
        $logger->write($query, 'QUERY');
    }
    $result = mysqli_query(${$link}, $query) or tep_db_error($query, mysqli_errno(${$link}), mysqli_error(${$link}));
    return $result;
}
开发者ID:zel777,项目名称:Responsive-osCommerce,代码行数:12,代码来源:database.php


示例3: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link};
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        $result_error = mysql_error();
        error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    return $result;
}
开发者ID:respencer,项目名称:oscommerce2,代码行数:13,代码来源:database.php


示例4: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link}, $logger;
    /*if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
        if (!is_object($logger)) $logger = new logger;
        $logger->write($query, 'QUERY');
      }*/
    $start_time = microtime(true);
    $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
    $time = microtime(true) - $start_time;
    $count++;
    /*if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
        if (mysql_error()) $logger->write(mysql_error(), 'ERROR');
      }*/
    return $result;
}
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:16,代码来源:database.php


示例5: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link}, $logger;
    mysql_query("set names 'utf8'");
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        if (!is_object($logger)) {
            $logger = new logger();
        }
        $logger->write($query, 'QUERY');
    }
    $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        if (mysql_error()) {
            $logger->write(mysql_error(), 'ERROR');
        }
    }
    return $result;
}
开发者ID:laiello,项目名称:hotel-os,代码行数:18,代码来源:database.php


示例6: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link}, $queries_count;
    $queries_count++;
    $start_time = microtime(true);
    $start_date_str = date('Ymd');
    $start_time_str = date('h:i:s');
    $result = @mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(${$link}), mysql_error(${$link}));
    $queries_duration = microtime(true) - $start_time;
    if ($queries_duration >= 5) {
        $db_time_file = @fopen(SESSION_WRITE_DIRECTORY . '/dbtimes_' . $start_date_str . '.txt', 'a');
        if ($db_time_file) {
            //echo 'YES';
            fwrite($db_time_file, '[' . date('h:i:s') . '] (' . $start_time_str . ', admin) ' . $queries_duration . ' ' . $query . ' [' . $_SERVER["REQUEST_URI"] . ']' . PHP_EOL);
            fclose($db_time_file);
        }
    }
    return $result;
}
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:19,代码来源:database.php


示例7: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    // LINE CHANGED: Added $debug
    global ${$link}, $debug;
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    $start_time = microtime(true);
    $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
    if (class_exists('KissER')) {
        KissER::q(round(microtime(true) - $start_time, 4), $query);
    }
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        $result_error = mysql_error();
        error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    // LINE ADDED
    $debug['QUERIES'][] = $query;
    return $result;
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:20,代码来源:database.php


示例8: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link}, $debug;
    $query_start = microtime();
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        $result_error = mysql_error();
        error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    if (DISPLAY_QUERIES == 'true' || DISPLAY_PAGE_PARSE_TIME == 'true') {
        $_start = explode(' ', $query_start);
        $_end = explode(' ', microtime());
        $_time = number_format($_end[1] + $_end[0] - ($_start[1] + $_start[0]), 6);
        $debug['QUERIES'][] = $query;
        $debug['TIME'][] = $_time;
    }
    return $result;
}
开发者ID:eosc,项目名称:EosC-2.3,代码行数:21,代码来源:database.php


示例9: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link}, $logger;
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        if (!is_object($logger)) {
            $logger = new logger();
        }
        $logger->write($query, 'QUERY');
    }
    $query = preg_replace('/\\s+/', ' ', $query);
    //$start_time = microtime(true);
    $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
    //$stop_time = microtime(true);
    //echo '<br><br>Total Records: '.mysql_num_rows($result);
    //echo '<br>Time taken: '.number_format($stop_time-$start_time,4);
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        if (mysql_error()) {
            $logger->write(mysql_error(), 'ERROR');
        }
    }
    return $result;
}
开发者ID:rrecurse,项目名称:IntenseCart,代码行数:22,代码来源:database.php


示例10: db_config

function db_config()
{
    $sql = 'SELECT configuration_group_id AS id FROM ' . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title='Elm@r'";
    $rs = tep_db_query($sql);
    if ($rs) {
        if ($row = tep_db_fetch_array($rs)) {
            $gid = $row['id'];
            echo "Elm@r-Konfigurationsgruppe gefunden: {$gid}\n";
        }
    }
    if (empty($gid)) {
        $sql = 'INSERT INTO ' . TABLE_CONFIGURATION_GROUP . "(configuration_group_title, configuration_group_description) VALUES('Elm@r', 'Shop- und Produktdaten gem&auml;&szlig; shopinfo.xml-Standard')";
        $rs = tep_db_query($sql);
        if ($rs == 1) {
            $gid = tep_db_insert_id();
            echo "Elm@r-Konfigurationsgruppe eingef&uuml;gt: {$gid}\n";
        } else {
            echo "Einf&uuml;gen der Elm@r-Konfigurationsgruppe hat nicht geklappt:\n";
            tep_db_error($sql, mysql_errno(), mysql_error());
        }
    }
    $sql = 'SELECT COUNT(*) AS cnt FROM ' . TABLE_CONFIGURATION . ' WHERE configuration_key=\'MODULE_ELMAR_WARN_ELMAR_RENAME\'';
    $rs = tep_db_query($sql);
    if ($rs && ($row = tep_db_fetch_array($rs)) && $row['cnt'] > 0) {
        echo "Elm@r-Konfigurationswert vorhanden.\n";
    } else {
        $sql = 'INSERT INTO ' . TABLE_CONFIGURATION . "(configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Verzeichnis-umbenennen-Warnung', 'MODULE_ELMAR_WARN_ELMAR_RENAME', 'False', 'Warnen, wenn das elmar-Verzeichnis noch nicht umbenannt wurde (siehe readme.html).', {$gid}, 1, 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())";
        $rs = tep_db_query($sql);
        if ($rs == 1) {
            echo "Elm@r-Konfigurationswert eingef&uuml;gt.\n";
        } else {
            echo "Einf&uuml;gen eines Elm@r-Konfigurationswerts hat nicht geklappt.\n";
            tep_db_error($sql, mysql_errno(), mysql_error());
        }
    }
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:36,代码来源:install.php


示例11: tep_db_query

function tep_db_query($db_query)
{
    global $db_link;
    $result = mysql_query($db_query, $db_link) or tep_db_error($db_query, mysql_errno(), mysql_error());
    return $result;
}
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:6,代码来源:admin_customers.php


示例12: tep_db_query

 function tep_db_query($query, $link = 'db_link')
 {
     global ${$link};
     if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
         error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
     }
     switch (MH_DBTYPE) {
         case 'MYSQL':
             $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
             if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
                 $result_error = mysql_error();
                 error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
             }
             return $result;
             break;
         case 'MYSQLI':
             $result = mysqli_query(${$link}, $query) or tep_db_error($query, mysqli_errno(${$link}), mysqli_error(${$link}));
             if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
                 $result_error = mysqli_error(${$link});
                 error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
             }
             return $result;
             break;
         default:
             echo 'DB Type not supported';
     }
 }
开发者ID:cord,项目名称:mailbeez-installer,代码行数:27,代码来源:osc_database.php


示例13: tep_db_query

function tep_db_query($query, $link = 'db_link')
{
    global ${$link};
    $result = mysql_query($query, ${$link}) or tep_db_error($query, mysql_errno(), mysql_error());
    return $result;
}
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:6,代码来源:update.php


示例14: tep_db_list_query

/**
 * @param $query
 * @param string $link
 * @return resource
 */
function tep_db_list_query($query, $link = 'db_list_link')
{
    global ${$link_list};
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        if (STORE_PAGE_PARSE_TIME_PATH == 'relative') {
            $log_file = DIR_FS_CATALOG . STORE_PAGE_PARSE_TIME_LOG;
        } else {
            $log_file = STORE_PAGE_PARSE_TIME_LOG;
        }
        error_log('QUERY ' . $query . "\n", 3, $log_file);
    }
    //    xD3bug($query,1,'127.0.0.1');
    $result = mysql_query($query, ${$link_list}) or tep_db_error($query, mysql_errno(), mysql_error());
    if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS == 'true') {
        $result_error = mysql_error();
        if (STORE_PAGE_PARSE_TIME_PATH == 'relative') {
            $log_file = DIR_FS_CATALOG . STORE_PAGE_PARSE_TIME_LOG;
        } else {
            $log_file = STORE_PAGE_PARSE_TIME_LOG;
        }
        error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, $log_file);
    }
    return $result;
}
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:29,代码来源:database.php


示例15: setcookie

    if (session_id() != "" || isset($_COOKIE[session_name()])) {
        setcookie(session_name(), '', time() - 2592000, '/');
    }
    session_destroy();
}
if (isset($_SESSION['username'])) {
    //echo "You have been logged out!";
    if (isset($_SESSION['last_login'])) {
        $last_login = $_SESSION['last_login'];
        $ip_address = $_SESSION['ip_address'];
        $username = $_SESSION['username'];
        $con = tep_db_connect();
        if (!$con) {
            global ${$link};
            destroy_session_and_data();
            tep_db_error('Could not connect', mysqli_errno(${$link}), mysqli_error(${$link}));
        }
        $query = tep_db_query("UPDATE users SET last_login='{$last_login}' WHERE username='{$username}'");
        if (!$query) {
            destroy_session_and_data();
            die('Error: ' . mysql_error());
        }
        $query = tep_db_query("UPDATE users SET ip_address= INET_ATON('{$ip_address}') WHERE username='{$username}'");
        if (!$query) {
            destroy_session_and_data();
            die('Error: ' . mysql_error());
        }
    }
    destroy_session_and_data();
}
?>
开发者ID:darthur-inpost,项目名称:iris-management,代码行数:31,代码来源:logout.php


示例16: tep_db_query

function tep_db_query($query)
{
    global $session_userinfo, $db;
    $query_bgn = list($old_usec, $old_sec) = explode(' ', microtime());
    $result = mysql_query($query, $db) or tep_db_error($query, mysql_errno(), mysql_error());
    $query_end = list($new_usec, $new_sec) = explode(' ', microtime());
    $runtime = (double) $new_usec + (double) $new_sec - ((double) $old_usec + (double) $old_sec);
    if ($runtime > 1) {
        //when query is too slow, log it to to a file
        $username = isset($session_userinfo) ? $session_userinfo['username'] : 'NOSESSION';
        use_class('logger');
        $logger = new logger('general', 'query_slow', false);
        $logger->write('User: ' . $username);
        $logger->write($_SERVER['REQUEST_URI']);
        if (isset($_POST) && count($_POST) > 0) {
            $logger->write('--- POST vars sent ---');
            foreach ($_POST as $pk => $pv) {
                $logger->write("{$pk} = {$pv}");
            }
            $logger->write('--- POST vars end ---');
        }
        $logger->write('Total Execution Time: ' . $runtime . ' seconds');
        $logger->write($query);
        $logger->close();
    }
    return $result;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:27,代码来源:functions.php


示例17: tep_db_select_db

function tep_db_select_db($database)
{
    if (!mysql_select_db($database)) {
        tep_db_error(mysql_error());
    }
}
开发者ID:noikiy,项目名称:qdpm,代码行数:6,代码来源:databaseHelper.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tep_db_fetch_array函数代码示例发布时间:2022-05-23
下一篇:
PHP tep_db_data_seek函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap