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

PHP MySQLDatabase类代码示例

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

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



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

示例1: sendQuery

 /**
  * @see MySQLDatabase::sendQuery()
  */
 public function sendQuery($query, $limit = 0, $offset = 0)
 {
     $startTime = microtime(true);
     $result = parent::sendQuery($query . ($limit > 0 ? " LIMIT " . $limit . " OFFSET " . $offset : ""));
     $endTime = microtime(true);
     $this->time += $endTime - $startTime;
     return $result;
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:11,代码来源:LWMySQLDatabase.class.php


示例2: destroy

 function destroy()
 {
     // Destructor
     $this->_mainTableName = null;
     $this->_defFile->destroy();
     $this->_defFile = null;
     MySQLDatabase::destroy();
 }
开发者ID:Ethennoob,项目名称:Web,代码行数:8,代码来源:classLogDatabase.php


示例3: __construct

 public function __construct($credsVar)
 {
     $this->credsVar = $credsVar;
     $this->logQueries = defined('LOGQUERIES') && LOGQUERIES;
     $this->uniqueID = 'sqldb-' . session_id();
     if (!file_exists(MYSQLVARPATH)) {
         mkdir(MYSQLVARPATH);
     }
     MySQLDatabase::GC();
 }
开发者ID:bnorm-software,项目名称:barkeep-backend,代码行数:10,代码来源:CLASS_MySQLDatabase.php


示例4: array

<?php

global $project;
$project = 'mysite';
global $databaseConfig;
$databaseConfig = array("type" => 'MySQLDatabase', "server" => 'localhost', "username" => 'root', "password" => 'omega', "database" => 'vp', "path" => '');
MySQLDatabase::set_connection_charset('utf8');
// Set the current theme. More themes can be downloaded from
// http://www.silverstripe.org/themes/
SSViewer::set_theme('simple');
// Set the site locale
i18n::set_locale('en_US');
FulltextSearchable::enable();
// Enable nested URLs for this site (e.g. page/sub-page/)
if (class_exists('SiteTree')) {
    SiteTree::enable_nested_urls();
}
Director::set_environment_type("dev");
// add a button to remove formatting
HtmlEditorConfig::get('cms')->insertButtonsBefore('styleselect', 'removeformat');
// tell the button which tags it may remove
HtmlEditorConfig::get('cms')->setOption('removeformat_selector', 'b,strong,em,i,span,ins');
//remove font->span conversion
HtmlEditorConfig::get('cms')->setOption('convert_fonts_to_spans', 'false,');
HtmlEditorConfig::get('cms')->setOptions(array('valid_elements' => "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class],small", 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],#iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]"));
// TinyMCE cleanup on paste
HtmlEditorConfig::get('cms')->setOption('paste_auto_cleanup_on_paste', 'true');
HtmlEditorConfig::get('cms')->setOption('paste_remove_styles', 'true');
HtmlEditorConfig::get('cms')->setOption('paste_remove_styles_if_webkit', 'true');
HtmlEditorConfig::get('cms')->setOption('paste_strip_class_attributes', 'true');
GD::set_default_quality(80);
开发者ID:javeriaaali,项目名称:student-org-kit,代码行数:31,代码来源:_config.php


示例5: MySQLDatabase

<?php

# Instance of MySQLDatabase
$database = new MySQLDatabase();
# Instance of Session
$session = new Session();
# Instance of User
$user = User::find_by_id($session->id);
$application_no = customDecrypt($_GET["app_no"]);
?>
<h5 align="center">Transcript Application</h5>
<hr>
<h6 align="center">All Fields are Required</h6>
<form action="" method="POST" class="application_form form-horizontal" >
    <!-- Fullname -->
    <div class="control-group">
        <label class="control-label" for="inputApplicationFormNumber">Application Number</label>
        <div class="controls">
            <div class="input-prepend">
                <span class="add-on"><i class="iconic-hash"></i></span>
                <input type="text" class="input-xlarge" required id="app_no" name="app_no" value="<?php 
if (isset($application_no)) {
    echo $application_no;
}
?>
" readonly="readonly" />
            </div>
        </div>
    </div>

    <!-- Title -->
开发者ID:Ghaji,项目名称:transcripts,代码行数:31,代码来源:transcript_application.php


示例6: MySQLDatabase

<?php

require_once '../inc/initialize.php';
$db_academic = new MySQLDatabase();
$sql_exam = "SELECT * FROM exam_id";
$result_exam = $db_academic->query($sql_exam);
while ($record = $db_academic->fetch_array($result_exam)) {
    echo '<option value="' . $record['exam_type_id'] . '">' . $record['exam_name'] . '</option>';
}
开发者ID:Ghaji,项目名称:form_application,代码行数:9,代码来源:ajax_display_exam.php


示例7: FileCache

    $zoom = $_REQUEST["zoom"];
    // Validate the input parameters
    if (is_numeric($tllon) && -180.0 <= $tllon && $tllon < 180.0 && is_numeric($tllat) && -90.0 <= $tllat && $tllat <= 90.0 && is_numeric($brlon) && -180.0 <= $brlon && $brlon < 180.0 && is_numeric($brlat) && -90.0 <= $brlat && $brlat <= 90.0 && is_numeric($zoom) && $zoom >= 0 && $zoom < 20) {
        $min_lat = $tllat < $brlat ? $tllat : $brlat;
        $max_lat = $tllat > $brlat ? $tllat : $brlat;
        $min_lon = $tllon < $brlon ? $tllon : $brlon;
        $max_lon = $tllon > $brlon ? $tllon : $brlon;
        $key = "poi_" . $min_lat . "_" . $max_lat . "_" . $min_lon . "_" . $max_lon . "_" . $zoom;
        if (strcmp($cache_type, "FileCache") == 0) {
            $cache = new FileCache();
        } else {
            $cache = new NoCache();
        }
        $xml = $cache->get($key);
        if ($xml == FALSE) {
            $db = new MySQLDatabase($hostname, $database, $username, $password);
            $db->connect();
            $poi = new POIManager($db);
            $gpx = $poi->getWpts($min_lat, $max_lat, $min_lon, $max_lon, $zoom);
            $xml = $gpx->toXml();
            $db->disconnect();
            $cache->put($key, $xml);
        }
        header("Content-type: text/xml; charset=utf-8");
        print $xml;
    } else {
        header("Content-type: text/plain; charset=utf-8");
        print "Invalid Input";
    }
} else {
    header("Content-type: text/plain; charset=utf-8");
开发者ID:hozmaster,项目名称:odopoi,代码行数:31,代码来源:api.php


示例8: include_layout_template

		<!-- //header -->
		<br>
		<br>

		<!-- Content -->
		<div class="row-fluid">

			<?php 
include_layout_template('admin_menu.php');
?>

			<div class="span9">
				<h2>Active Notifications</h2>
				<hr>
						<?php 
$database = new MySQLDatabase();
$active_notifications = "SELECT * FROM `applicant_notifications` as app_not JOIN `personal_details` as per WHERE status = 1 AND recipient_id = " . $session->applicant_id . " AND app_not.sender_id=per.applicant_id";
$result = $database->query($active_notifications);
$pagecounter = 1;
$serialno = 1;
$max = 10;
$number_of_notifications = $database->num_rows($result);
echo '<div class="tabbable">
								<div class="tab-content">';
while ($row = $database->fetch_array($result)) {
    if ($serialno % $max == 1) {
        if ($pagecounter == 1) {
            echo '<div class="tab-pane active" id="' . $pagecounter . '">';
        } else {
            echo '<div class="tab-pane" id="' . $pagecounter . '">';
        }
开发者ID:Ghaji,项目名称:form_application,代码行数:31,代码来源:view_applicant_active_notifications.php


示例9: MySQLDatabase

<?php

require_once "inc/initialize.php";
$database = new MySQLDatabase();
$session = new Session();
$user = User::find_by_id($session->id);
?>
<h3 align="center">Select Payment for Transcript Application</h3>
<hr> 
<h6 align="center">All Fields are Required</h6>
<form action="pay.php" method="POST" class="create_form form-horizontal" >
    <!-- Fullname -->
    <div class="control-group">
        <label class="control-label" for="inputEmail">Full Name</label>
        <div class="controls">
            <div class="input-prepend">
                <span class="add-on"><i class="icon-user"></i></span>
                <input type="text" class="input-xlarge" required id="full_name" name="full_name" value="<?php 
if (isset($user->full_name)) {
    echo $user->full_name;
}
?>
" placeholder="Surname, Firstname, middlename" readonly="" />
            </div>
        </div>
    </div>
    <!-- Delivery type -->
    <?php 
$sql_type = "SELECT * FROM delivery_type WHERE dt_visible = 1";
$result = $database->query($sql_type);
?>
开发者ID:Ghaji,项目名称:transcripts,代码行数:31,代码来源:make_payment.php


示例10: Session

<?php

# Instance of Session
$session = new Session();
# Instance of MySQLDatabase
$db = new MySQLDatabase();
// print_r( $type);
// die();
# Count the number of submitted transcript applications for an applicant
$query_count = "SELECT count(*) FROM feedbacks WHERE applicant_id ='" . $session->id . "' ";
$result_count = $db->query($query_count);
$feedbacks_count = $db->fetch_array($result_count);
$count = array_shift($feedbacks_count);
// 1. the current page number ($current_page)
$page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
// 2. records per page ($per_page)
$per_page = 3;
// 3. total record count ($total_count)
$total_count = $count;
// use pagination instead
$pagination = new Pagination($page, $per_page, $total_count);
// Instead of finding all records, just find the records
// for this page
$sql = "SELECT * FROM feedbacks WHERE applicant_id ='" . $session->id . "' ORDER BY `id` DESC ";
$sql .= "LIMIT {$per_page} ";
$sql .= "OFFSET {$pagination->offset()}";
$active_feedbacks = Feedback::find_by_sql($sql);
// Need to add ?page=$page to all links we want to
// maintain the current page (or store $page in $session)
$counter = 1;
?>
开发者ID:Ghaji,项目名称:transcripts,代码行数:31,代码来源:cheack_my_feedbacks.php


示例11: form_id_generator

function form_id_generator($applicant_id, $programme)
{
    //get the length of random number to generate
    $random_number_length = 6 - strlen($applicant_id);
    //get d last two digits of the session
    $database = new MySQLDatabase();
    $selectsessionsql = $database->query("SELECT session FROM application_status WHERE id=1");
    $result = $database->fetch_array($selectsessionsql);
    $year = explode('/', $result['session']);
    $year = substr($year[0], 2, 2);
    $random_number = rand(pow(10, $random_number_length - 1), pow(10, $random_number_length) - 1);
    // The function returns year, programme
    return $year . $programme . $random_number . $applicant_id;
}
开发者ID:Ghaji,项目名称:form_application,代码行数:14,代码来源:functions.php


示例12: redirect_to

<?php

require_once "../inc/initialize.php";
//checks if admin user is logged in
if (!$session->is_admin_logged_in()) {
    redirect_to('index.php');
}
// if($_SESSION["role"] != 1 || $_SESSION["role"] != 6){
// redirect_to('home.php');
// }
$database = new MySQLDatabase();
?>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>University of Jos, Nigeria</title>
		<?php 
require_once LIB_PATH . DS . 'css.php';
?>
        <link rel="stylesheet" href="js/plugins/datetimepicker/jquery.datetimepicker.css">
	</head>

	<body>

		<!-- beginnning of main content-->
		<!-- header -->
		<?php 
include_layout_template('admin_header.php');
?>
		<!-- //header -->
开发者ID:Ghaji,项目名称:form_application,代码行数:31,代码来源:view_payment_acc.php


示例13: redirect_to

<?php

require_once "../inc/initialize.php";
//checks if admin user is logged in
if (!$session->is_admin_logged_in()) {
    redirect_to('index.php');
}
// if($_SESSION["role"] != 1 || $_SESSION["role"] != 6){
// redirect_to('home.php');
// }
$database = new MySQLDatabase();
?>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>University of Jos, Nigeria</title>
		<?php 
require_once LIB_PATH . DS . 'css.php';
?>
	</head>

	<body>

		<!-- beginnning of main content-->
		<!-- header -->
		<?php 
include_layout_template('admin_header.php');
?>
		<!-- //header -->
		<br>
开发者ID:Ghaji,项目名称:form_application,代码行数:31,代码来源:view_log_acc.php


示例14: redirect_to

<?php

require_once "inc/initialize.php";
if (!$session->is_logged_in()) {
    redirect_to('index.php');
}
$user = new User();
$user->applicant_id = $session->applicant_id;
$progress = $user->find_by_sql("SELECT progress FROM personal_details WHERE applicant_id='" . $user->applicant_id . "'");
$progress = array_shift($progress);
if ($progress->progress != 'Completed') {
    redirect_to('application_form.php');
}
$student_status = $user->get_student_status();
$database = new MySQLDatabase();
?>

<?php 
$personal_details = $database->query("SELECT * FROM personal_details p, title t, lga l, state s, religion r, nationality n, department d, faculty f, next_of_kin next, marital mar, photographs photo WHERE p.applicant_id='" . $session->applicant_id . "' AND p.title_id=t.title_id AND p.lga_id=l.lga_id AND l.state_id=s.state_id AND p.religion_id=r.religion_id AND p.country_id=n.country_id AND p.programme_applied_id=d.department_id AND d.faculty_id=f.faculty_id AND p.applicant_id=next.applicant_id AND p.applicant_id=photo.applicant_id AND p.marital_status=mar.marital_status_id");
$personal_details = $database->fetch_array($personal_details);
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>University of Jos, Nigeria - <?php 
echo $personal_details['faculty_name'];
?>
 Complete Application Form</title>
<?php 
require_once LIB_PATH . DS . 'javascript.php';
开发者ID:Ghaji,项目名称:form_application,代码行数:31,代码来源:home.php


示例15: MySQLDatabase

<?php

$db = new MySQLDatabase();
$session = new Session();
$applicant_fullname = User::applicant_fullname($session->applicant_id);
$result_details = User::find_by_id($session->applicant_id);
$display_greeting = greeting();
/**/
$active_sql = "SELECT COUNT(*) FROM `applicant_notifications` WHERE status = 1 AND recipient_id = " . $session->applicant_id;
$total_active = $db->query($active_sql);
$total_active = $db->fetch_array($total_active);
$total_active = array_shift($total_active);
$inactive_sql = "SELECT COUNT(*) FROM `applicant_notifications` WHERE status = 2 AND recipient_id = " . $session->applicant_id;
$total_inactive = $db->query($inactive_sql);
$total_inactive = $db->fetch_array($total_inactive);
$total_inactive = array_shift($total_inactive);
$admissions = new Admission();
$sql = "select * from admission_status where applicant_id='" . $session->applicant_id . "'";
$admissions = Admission::find_by_sql($sql);
foreach ($admissions as $admission) {
    $time = $admission->time_completed_application;
    $academic_session = $admission->academic_session;
    $status = $admission->status;
    $reason_ = $admission->reason;
}
?>

<div class="navbar">
  <div class="navbar-inner"> <a class="brand" href="#"></a>
    <ul class="nav nav-tabs">
      <li class="active"><a href="home.php"><span><i class="icon-home"></i> </span> Home</a></li>
开发者ID:Ghaji,项目名称:form_application,代码行数:31,代码来源:confirmation_menu.php


示例16: getDataFromDB

 /**
  * Get settings data from DB.
  *
  * @access	private
  * @return	array
  */
 private function getDataFromDB()
 {
     $data = array();
     $query = $this->db->query("\n\t\t\tSELECT setting_name, setting_value\n\t\t\tFROM ts_system_settings\n\t\t\tORDER BY id\n\t\t");
     while (($row = $this->db->fetchAssoc($query)) != NULL) {
         $data[$row['setting_name']] = $row['setting_value'];
     }
     return $data;
 }
开发者ID:jahanzaibbahadur,项目名称:Ticket-System,代码行数:15,代码来源:Cache.php


示例17: query

 public function query($sql, $errorLevel = E_USER_ERROR)
 {
     $query = new stdClass();
     $query->query = $sql;
     $query->source = '';
     $query->count = 0;
     $trace = $this->userCaller();
     if ($trace) {
         $query->source = 'Line ' . $trace['line'] . ' in ' . $trace['file'];
     }
     $this->queryRecord[] = $query;
     if (isset($this->allQueries[$sql])) {
         $cur = isset($this->duplicateQueries[$sql]) ? $this->duplicateQueries[$sql] : $query;
         if (!isset($cur->count)) {
             $cur->query = $sql;
             $cur->count = 0;
         }
         $cur->count = $cur->count + 1;
         if ($cur->count > 2 && !isset($cur->source)) {
             // lets see where it's coming from
             $trace = $this->userCaller();
             if ($trace) {
                 $cur->source = 'Line ' . $trace['line'] . ' in ' . $trace['file'];
             }
         }
         $this->duplicateQueries[$sql] = $cur;
     }
     // mark as having executed this query
     $this->allQueries[$sql] = true;
     return parent::query($sql, $errorLevel);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-ssautesting,代码行数:31,代码来源:DevMySQLDatabase.php


示例18: query

 public function query($sql, $errorLevel = E_USER_ERROR)
 {
     if (in_array(strtolower(substr($sql, 0, strpos($sql, ' '))), $this->writeQueries)) {
         throw new Exception("Attempted to write to readonly database");
     }
     return parent::query($sql, $errorLevel);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-ssautesting,代码行数:7,代码来源:DummyReadonlyMySQLDatabase.php


示例19: setCharset

 /**
  * Sets the charset of the database connection.
  * 
  * @param	string		$charset
  */
 public function setCharset($charset)
 {
     if (function_exists('mysqli_set_charset')) {
         $this->mySQLi->set_charset($charset);
     } else {
         parent::setCharset($charset);
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:13,代码来源:MySQLiDatabase.class.php


示例20: query

 /**
  * If a write query is detected, hand it off to the configured write database
  * 
  * @param string $sql
  * @param int $errorLevel
  * @return \MySQLQuery
  */
 public function query($sql, $errorLevel = E_USER_ERROR)
 {
     if (in_array(strtolower(substr($sql, 0, strpos($sql, ' '))), $this->writeQueries) || $this->writePerformed) {
         $alternateReturn = $this->writeDb()->query($sql, $errorLevel);
         $this->writePerformed = true;
         return $alternateReturn;
     }
     return parent::query($sql, $errorLevel);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-silverstripe-splitdb,代码行数:16,代码来源:ReadWriteMySQLDatabase.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP MySQLPDOTest类代码示例发布时间:2022-05-23
下一篇:
PHP MySQL类代码示例发布时间: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