本文整理汇总了PHP中Mysql::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::load方法的具体用法?PHP Mysql::load怎么用?PHP Mysql::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mysql
的用法示例。
在下文中一共展示了Mysql::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ad_to_bc
'H' => 'H �Դ������Ҵ�����Ѻ������ ��ͧ������ѡ�ҷӡ�á����Ե/��ͺ���ª��Ե',
'I' => 'I �Դ������Ҵ�����Ѻ������ ��ͧ������ѡ�Ҷ֧����Ե'
);
$date = ad_to_bc(input_get('date'));
$group = input_get('group');
$conf = array(
'host' => 'localhost',
'port' => 3306,
'dbname' => 'dbconform',
'user' => 'root',
'pass' => '1234'
);
$db = Mysql::load($conf);
$sql = "SELECT a.*, b.`name`
FROM `ncr2556` AS a
LEFT JOIN `departments` AS b ON b.`code` = a.`until`
WHERE a.`nonconf_date` LIKE '$date%'
AND a.`come_from_id` = '$group'
ORDER BY b.`id` ASC";
$db->select($sql);
$items = $db->get_items();
?>
<style type="text/css">
td, th{
padding: 2px;
}
</style>
<div class="col">
示例2: input
<?php
include 'bootstrap.php';
$action = input('action');
if( $action === false ){
include 'templates/classic/header.php';
$db = Mysql::load();
$sql = "SELECT `row_id`,`name`,`menucode` FROM `inputm`
WHERE level = 'user'
ORDER BY `name` ASC";
$db->select($sql);
$users = $db->get_items();
?>
<div class="col">
<div class="cell">
<form action="user_durgcontrol.php" method="post">
<div class="col">
<div class="cell">
<select name="user" id="user">
<option value="">àÅ×Í¡¼Ùéãªé§Ò¹</option>
<?php
foreach( $users as $key => $user ){
?>
<option value="<?=$user['row_id'];?>"><?=$user['name'];?></option>
<?php
示例3: testConstructThrowsPDOExceptionOnConnection
/**
* @expectedException \PDOException
*/
public function testConstructThrowsPDOExceptionOnConnection()
{
$this->object = new Mysql(array('schema' => 'invalid', 'host' => 'localhost', 'password' => 'invalid', 'user' => 'invalid', 'type' => 'mysql'));
$meta = $this->object->load('types');
$this->setExpectedException('\\PDOException');
}