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


PHP DatabaseHandler类代码示例

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


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

示例1: importDataFromDumpFile

function importDataFromDumpFile($sid, DatabaseHandler $dbHandler, $userId, $filePath, $my_pligg_base_no_slash)
{
    $ktrExeDao = new KTRExecutorDAO();
    $tableNames = $dbHandler->loadTables();
    $logIds = array();
    foreach ($tableNames as $tableName) {
        $logIds[$tableName] = $ktrExeDao->addExecutionInfoTuple($sid, $tableName, $userId);
    }
    try {
        $dbImporter = DatabaseImporterFactory::createDatabaseImporter($dbHandler->getDriver(), $sid, $my_pligg_base_no_slash);
        $dbImporter->importDbData($filePath);
        foreach ($logIds as $logId) {
            $ktrExeDao->updateExecutionInfoStatus($logId, 'success');
        }
    } catch (Exception $e) {
        foreach ($logIds as $logId) {
            $ktrExeDao->updateExecutionInfoStatus($logId, 'error');
            $ktrExeDao->updateExecutionInfoErrorMessage($logId, $e->getMessage());
        }
    }
    $queryEngine = new QueryEngine();
    foreach ($logIds as $tableName => $logId) {
        $numProcessed = $queryEngine->GetTotalNumberTuplesInTableBySidAndNameFromExternalDB($sid, $tableName);
        $ktrExeDao->updateExecutionInfoTupleAfterPanTerminated($logId, 0, '', $numProcessed, 'success');
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:26,代码来源:import_dump_parallel.php

示例2: __construct

 /**
  * Konstruktor.
  */
 function __construct()
 {
     include_once FRAME_PATH . 'DatabaseHandler.php';
     $dbHandler = new DatabaseHandler('matyas01_cloudsDB', 'matyas01_mkvadmn', 'nrgbbksv');
     $this->db = $dbHandler->getDBO();
     $this->processing();
 }
开发者ID:majtenyim,项目名称:thesis-webserver,代码行数:10,代码来源:Base.php

示例3: updateTag

 public function updateTag($tag_id, $name)
 {
     $params[] = $name;
     $params[] = $post_id;
     $sql = "UPDATE {$this->tags} SET name = ? WHERE post_id = ?";
     DatabaseHandler::Execute($sql, $params);
 }
开发者ID:khoteevnd,项目名称:mb,代码行数:7,代码来源:Model_Tag_class.php

示例4: educations_Insert

 public static function educations_Insert($user_id, $education_level, $education_average, $education_university, $education_branch, $education_sub_branch, $from_date, $to_date, $now, $activities, $attach_file)
 {
     $sql = 'CALL `sp_educations_Insert`(:user_id, :education_level, :education_average, :education_university, :education_branch, :education_sub_branch, :from_date, :to_date, :now, :activities, :attach_file)';
     $params = array(':user_id' => $user_id, ':education_level' => $education_level, ':education_average' => $education_average, ':education_university' => $education_university, ':education_branch' => $education_branch, ':education_sub_branch' => $education_sub_branch, ':from_date' => $from_date, ':to_date' => $to_date, ':now' => $now, ':activities' => $activities, ':attach_file' => $attach_file);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:EDUCATIONS.php

示例5: GetDepartments

 public static function GetDepartments()
 {
     // Составляем SQL-запрос
     $sql = 'CALL catalog_get_departments_list()';
     // Выполняем запрос и получаем результаты
     return DatabaseHandler::GetAll($sql);
 }
开发者ID:kulikovalexey,项目名称:myshop,代码行数:7,代码来源:catalog.php

示例6: blog_subject_Insert

 public static function blog_subject_Insert($subject_name)
 {
     $sql = 'CALL `sp_blog_subject_Insert`(:subject_name)';
     $params = array(':subject_name' => $subject_name);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:BLOG_SUBJECT.php

示例7: admins_Insert

 public static function admins_Insert($first_name, $last_name, $password, $mobile, $about, $roles_id)
 {
     $sql = 'CALL `sp_admins_Insert`(:first_name, :last_name, :password, :mobile, :about, :roles_id)';
     $params = array(':first_name' => $first_name, ':last_name' => $last_name, ':password' => $password, ':mobile' => $mobile, ':about' => $about, ':roles_id' => $roles_id);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:ADMINS.php

示例8: roles_Insert

 public static function roles_Insert($title)
 {
     $sql = 'CALL `sp_roles_Insert`(:title)';
     $params = array(':title' => $title);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:ROLES.php

示例9: blog_keywords_Insert

 public static function blog_keywords_Insert($blog_id, $keyword)
 {
     $sql = 'CALL `sp_blog_keywords_Insert`(:blog_id, :keyword)';
     $params = array(':blog_id' => $blog_id, ':keyword' => $keyword);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:BLOG_KEYWORDS.php

示例10: favorite_user_Insert

 public static function favorite_user_Insert($favorite_blog, $user_id)
 {
     $sql = 'CALL `sp_favorite_user_Insert`(:favorite_blog, :user_id)';
     $params = array(':favorite_blog' => $favorite_blog, ':user_id' => $user_id);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:FAVORITE_USER.php

示例11: getTeacherByid

function getTeacherByid($teacherid)
{
    $sql = "SELECT * FROM teacher WHERE ID = :teacherid";
    $params = array(':teacherid' => $teacherid);
    $result = DatabaseHandler::GetAll($sql, $params);
    return $result[0]['Name'];
}
开发者ID:RonishKalia,项目名称:Feedback-Portal,代码行数:7,代码来源:functions.php

示例12: connect

 public function connect()
 {
     $dbh = DatabaseHandler::getInstance();
     $dbh->filePath = __DIR__ . '/squid_database.sqlite';
     $dbh->openDBMS('sqlite');
     return $dbh;
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:SquidDatabase.php

示例13: users_Insert

 public static function users_Insert($first_name, $last_name, $password, $job_title, $gender, $marriage_state, $profile_pic, $cover_pic, $birthday, $mobile, $tel, $address, $email, $website, $job_state, $job_kind, $salary, $city_id, $about_me, $register_date)
 {
     $sql = 'CALL `sp_users_Insert`(:first_name, :last_name, :password, :job_title, :gender, :marriage_state, :profile_pic, :cover_pic, :birthday, :mobile, :tel, :address, :email, :website, :job_state, :job_kind, :salary, :city_id, :about_me, :register_date)';
     $params = array(':first_name' => $first_name, ':last_name' => $last_name, ':password' => $password, ':job_title' => $job_title, ':gender' => $gender, ':marriage_state' => $marriage_state, ':profile_pic' => $profile_pic, ':cover_pic' => $cover_pic, ':birthday' => $birthday, ':mobile' => $mobile, ':tel' => $tel, ':address' => $address, ':email' => $email, ':website' => $website, ':job_state' => $job_state, ':job_kind' => $job_kind, ':salary' => $salary, ':city_id' => $city_id, ':about_me' => $about_me, ':register_date' => $register_date);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:USERS.php

示例14: comments_Insert

 public static function comments_Insert($full_name, $mail, $text, $add_time, $activate, $ip, $user_id, $admin_id, $blog_id, $comment_id)
 {
     $sql = 'CALL `sp_comments_Insert`(:full_name, :mail, :text, :add_time, :activate, :ip, :user_id, :admin_id, :blog_id, :comment_id)';
     $params = array(':full_name' => $full_name, ':mail' => $mail, ':text' => $text, ':add_time' => $add_time, ':activate' => $activate, ':ip' => $ip, ':user_id' => $user_id, ':admin_id' => $admin_id, ':blog_id' => $blog_id, ':comment_id' => $comment_id);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:COMMENTS.php

示例15: quotations_Insert

 public static function quotations_Insert($author, $text)
 {
     $sql = 'CALL `sp_quotations_Insert`(:author, :text)';
     $params = array(':author' => $author, ':text' => $text);
     DatabaseHandler::Close();
     return DatabaseHandler::Execute($sql, $params);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:QUOTATIONS.php


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