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


PHP dbconnection::dbconnect方法代码示例

本文整理汇总了PHP中dbconnection::dbconnect方法的典型用法代码示例。如果您正苦于以下问题:PHP dbconnection::dbconnect方法的具体用法?PHP dbconnection::dbconnect怎么用?PHP dbconnection::dbconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dbconnection的用法示例。


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

示例1: preload_lists

function preload_lists()
{
    $db = new dbconnection();
    $db->dbconnect();
    $db->query = "select listid,listname from " . TABLE_LISTS . " where active=1";
    $db->execute();
    $rowcount = $db->rowcount();
    if ($rowcount > 0) {
        for ($x = 0; $x < $rowcount; $x++) {
            $row = $db->fetchrow($x);
            $list[$x] = $row;
        }
    }
    return $list;
}
开发者ID:CallBest,项目名称:CallCenter-CIMS,代码行数:15,代码来源:preloadvalues.php

示例2: changepassword

 function changepassword($userid, $oldpass, $newpass, $newpassrepeat)
 {
     if ($newpass == $newpassrepeat) {
         $enc = new Encryption();
         $db = new dbconnection();
         $db->dbconnect();
         //check oldpass, update password if ok, send message if not
         $password = $enc->oneway_encode($oldpass);
         $db->query = "select userid from " . TABLE_USERS . " where userid={$userid} and password='{$password}'";
         $db->execute();
         if ($db->rowcount() > 0) {
             $newpass = $enc->oneway_encode($newpass);
             $db->query = "update " . TABLE_USERS . " set password='{$newpass}' where userid={$userid}";
             $db->execute();
             $msg = 'Password updated.';
         } else {
             $msg = 'Incorrect old password.';
         }
     } else {
         $msg = 'New password does not match.';
     }
     return $msg;
 }
开发者ID:CallBest,项目名称:CallCenter-CIMS,代码行数:23,代码来源:user.php

示例3: dbconnection

<?php

require_once '../../includes/dbase.php';
require_once '../../includes/settings.php';
$db = new dbconnection();
$db->dbconnect();
isset($_REQUEST['agent']) ? $agent = $_REQUEST['agent'] : exit;
isset($_REQUEST['leadid']) ? $leadid = $_REQUEST['leadid'] : exit;
$total = count($_FILES['upload']['name']);
// Loop through each file
for ($i = 0; $i < $total; $i++) {
    $tmpFilePath = $_FILES['upload']['tmp_name'][$i];
    if ($tmpFilePath != "") {
        $filename = $leadid . ' - ' . $_FILES["upload"]['name'][$i];
        $newFilePath = "../../uploads/{$filename}";
        //Upload the file into the temp dir
        if (move_uploaded_file($tmpFilePath, $newFilePath)) {
            $db->query = "\n        insert into " . TABLE_FILES . "\n        (leadid,filename,dateuploaded,agent)\n        values\n        ({$leadid},'{$filename}',now(),{$agent})\n        ";
            $db->execute();
            echo 'File <a href="uploads/' . $filename . '" target="_blank">' . $filename . ' uploaded.</a><br>';
        } else {
            echo 'Failed to upload file ' . $filename;
        }
    }
}
开发者ID:CallBest,项目名称:CallCenter-CIMS,代码行数:25,代码来源:upload.php


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