本文整理汇总了PHP中C::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP C::connect方法的具体用法?PHP C::connect怎么用?PHP C::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C
的用法示例。
在下文中一共展示了C::connect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($dbc)
{
global $config;
$this->dbc = isset($dbc) ? $dbc : C::connect();
$this->url = C::isLocal() ? $config['page']['local_url'] : $config['page']['server_url'];
}
示例2: __construct
function __construct($arr = null)
{
C::sessionStart();
//$pageXML = (C::isLocal())?C::getOutsidePath().'aj-db/aj_hfut_page.xml':C::getOutsidePath().'cgi-bin/aj_hfut_page.xml';
$pageXML = C::isLocal() ? 'config/aj_hfut_page.xml' : 'config/aj_hfut_page.xml';
$this->xml = simplexml_load_file($pageXML);
$this->url = C::isLocal() ? $this->xml->config->url['local'] : $this->xml->config->url['server'];
$this->dbc = C::connect();
$this->arr = isset($arr) ? $arr : null;
$this->table = "aj_tumu_users";
}
示例3: array
<?php
require_once 'config.php';
require_once 'c.php';
$dbc = C::connect();
$side = C::islocal() ? 'local' : 'server';
$rows = array();
$rows['blog_title'] = '';
$rows['blog_desc'] = '';
$rows['types'] = '';
$rows['blog_stamp'] = '';
$rows['file_content'] = '';
if (isset($_GET['blog_id']) and !isset($_POST['title'])) {
$id = (int) $_GET['blog_id'];
$query = "SELECT blog_title, blog_desc, blog_file, types, blog_stamp FROM blog WHERE blog_id = " . $id;
$result = C::query($query, $dbc);
$rows = mysql_fetch_array($result);
$rows['file_content'] = file_get_contents('../' . $config['blog']['filename'][$side] . $rows['blog_file'] . '.txt');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' and isset($_POST['title'])) {
$title = C::safe($_POST['title'], $dbc);
$desc = mysql_real_escape_string($_POST['desc']);
$stamp = C::safe($_POST['stamp'], $dbc);
$kinds = C::safe($_POST['kinds'], $dbc);
$content = $_POST['content'];
if (isset($_GET['blog_id'])) {
$blog_id = (int) $_GET['blog_id'];
$query = sprintf("UPDATE blog SET blog_title = '%s', blog_desc = '%s',types='%s', blog_stamp='%s' \n\t\t\t\t\t\t\tWHERE blog_id = %d ", $title, $desc, $kinds, $stamp, $blog_id);
if (C::query($query, $dbc)) {
$query = "SELECT blog_file FROM blog WHERE blog_id = " . $blog_id;
$result = C::query($query, $dbc);