本文整理汇总了PHP中mysqlConnection类的典型用法代码示例。如果您正苦于以下问题:PHP mysqlConnection类的具体用法?PHP mysqlConnection怎么用?PHP mysqlConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了mysqlConnection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertMember
function insertMember($host, $user, $pass, $database, $table)
{
$query = "INSERT INTO {$table} (ime,prezime,adresa,postnum,mjesto,telefon,email,skola,clan,auto,izlet,majica,boja,velicina,user,password) VALUES ('{$this->ime}', '{$this->prezime}', '{$this->adresa}', '{$this->brojPoste}', '{$this->mjesto}', '{$this->telefon}', '{$this->email}', '{$this->skola}', '{$this->clan}', '{$this->auto}', '{$this->izlet}', '{$this->majica}', '{$this->boja}', '{$this->velicina}', '{$this->username}', '" . md5($this->password) . "')";
try {
$conn = new mysqlConnection($host, $user, $pass, $database);
$conn->open();
mysql_query($query);
$success = true;
$conn->close();
unset($conn);
} catch (Exception $e) {
echo $e->getMessage();
$success = false;
}
return $success;
}
示例2: __construct
/**
dcCore constructor inits everything related to Dotclear. It takes arguments
to init database connection.
@param driver <b>string</b> Database driver name
@param host <b>string</b> Database hostname
@param db <b>string</b> Database name
@param user <b>string</b> Database username
@param password <b>string</b> Database password
@param prefix <b>string</b> DotClear tables prefix
@param persist <b>boolean</b> Persistent database connection
*/
public function __construct($driver, $host, $db, $user, $password, $prefix, $persist)
{
$this->con = dbLayer::init($driver, $host, $db, $user, $password, $persist);
# define weak_locks for mysql
if ($this->con instanceof mysqlConnection) {
mysqlConnection::$weak_locks = true;
}
$this->prefix = $prefix;
$this->error = new dcError();
$this->auth = $this->authInstance();
$this->session = new sessionDB($this->con, $this->prefix . 'session', DC_SESSION_NAME, '', null, DC_ADMIN_SSL);
$this->url = new urlHandler();
$this->plugins = new dcModules($this);
$this->rest = new dcRestServer($this);
$this->addFormater('xhtml', create_function('$s', 'return $s;'));
$this->addFormater('wiki', array($this, 'wikiTransform'));
}
示例3: __construct
/**
dcCore constructor inits everything related to Dotclear. It takes arguments
to init database connection.
@param driver <b>string</b> Database driver name
@param host <b>string</b> Database hostname
@param db <b>string</b> Database name
@param user <b>string</b> Database username
@param password <b>string</b> Database password
@param prefix <b>string</b> DotClear tables prefix
@param persist <b>boolean</b> Persistent database connection
*/
public function __construct($driver, $host, $db, $user, $password, $prefix, $persist)
{
$this->con = dbLayer::init($driver, $host, $db, $user, $password, $persist);
# define weak_locks for mysql
if ($this->con instanceof mysqlConnection) {
mysqlConnection::$weak_locks = true;
}
$this->prefix = $prefix;
$this->error = new dcError();
$this->auth = $this->authInstance();
$this->session = new sessionDB($this->con, $this->prefix . 'session', BP_SESSION_NAME, '', null, false);
$this->url = new urlHandler();
$this->rest = new dcRestServer($this);
# Create the Hyla_Tpl object
$this->tpl = new Hyla_Tpl();
$this->tpl->setL10nCallback('T_');
}
示例4: confCopy_options
function confCopy_options()
{
global $array;
$options = NULL;
$mysql = new mysqlConnection();
$mysql->select("\n\t\t\tSELECT *\n\t\t\tFROM toony_module_board_config\n\t\t\tWHERE board_id!='{$array['board_id']}'\n\t\t\tORDER BY name ASC\n\t\t");
if ($mysql->numRows() > 0) {
$options = "<option value=\"NONE\">게시판 선택</option>";
do {
$options .= "<option value=\"" . $mysql->fetch("board_id") . "\">" . $mysql->fetch("name") . " (" . $mysql->fetch("board_id") . ")</option>";
} while ($mysql->nextRec());
return $options;
} else {
return $options .= "<option value=\"NONE\">복사 대상 없음</option>";
}
}
示例5: __construct
/**
dcCore constructor inits everything related to Dotclear. It takes arguments
to init database connection.
@param driver <b>string</b> Database driver name
@param host <b>string</b> Database hostname
@param db <b>string</b> Database name
@param user <b>string</b> Database username
@param password <b>string</b> Database password
@param prefix <b>string</b> DotClear tables prefix
@param persist <b>boolean</b> Persistent database connection
*/
public function __construct($driver, $host, $db, $user, $password, $prefix, $persist)
{
if (defined('DC_START_TIME')) {
$this->stime = DC_START_TIME;
} else {
$this->stime = microtime(true);
}
$this->con = dbLayer::init($driver, $host, $db, $user, $password, $persist);
# define weak_locks for mysql
if ($this->con instanceof mysqlConnection) {
mysqlConnection::$weak_locks = true;
} elseif ($this->con instanceof mysqliConnection) {
mysqliConnection::$weak_locks = true;
}
# define searchpath for postgresql
if ($this->con instanceof pgsqlConnection) {
$searchpath = explode('.', $prefix, 2);
if (count($searchpath) > 1) {
$prefix = $searchpath[1];
$sql = 'SET search_path TO ' . $searchpath[0] . ',public;';
$this->con->execute($sql);
}
}
$this->prefix = $prefix;
$ttl = DC_SESSION_TTL;
if (!is_null($ttl)) {
if (substr(trim($ttl), 0, 1) != '-') {
// Clearbricks requires negative session TTL
$ttl = '-' . trim($ttl);
}
}
$this->error = new dcError();
$this->auth = $this->authInstance();
$this->session = new sessionDB($this->con, $this->prefix . 'session', DC_SESSION_NAME, '', null, DC_ADMIN_SSL, $ttl);
$this->url = new dcUrlHandlers();
$this->plugins = new dcPlugins($this);
$this->rest = new dcRestServer($this);
$this->meta = new dcMeta($this);
$this->log = new dcLog($this);
}
示例6: skinController
<?php
$tpl = new skinController();
$header = new skinController();
$loop = new skinController();
$footer = new skinController();
$mysql = new mysqlConnection();
$lib = new libraryClass();
$paging = new pagingClass();
$method = new methodController();
$method->method_param("GET", "page");
/*
페이징 설정
*/
$paging_query = "\n\t\tSELECT B.*,B.me_login_ip AS status_ip,A.guest_ip\n\t\tFROM toony_admin_member_online A\n\t\tLEFT OUTER JOIN toony_member_list B\n\t\tON A.me_idno=B.me_idno\n\t\tWHERE A.visitdate > DATE_SUB(now(), INTERVAL 55 MINUTE) AND (B.me_admin!='Y' OR B.me_admin IS NULL) AND B.me_drop_regdate IS NULL\n\t\tORDER BY A.visitdate DESC\n\t";
$mysql->select($paging_query);
$paging_query_no = $mysql->numRows();
$paging->page_param($page);
$total_num = $paging->setTotal($paging_query_no);
$paging->setListPerPage(10);
$sql = $paging->getPaggingQuery($paging_query);
$mysql->select($sql);
$array_total = $mysql->numRows();
/*
템플릿 로드
*/
$tpl->skin_file_path("admin/_tpl/connectingMember.html");
$header->skin_html_load($tpl->skin);
$header->skin_loop_header("[{loop_start}]");
$loop->skin_html_load($tpl->skin);
$loop->skin_loop_array("[{loop_start}]", "[{loop_end}]");
示例7: skinController
<?php
include_once __DIR_PATH__ . "modules/board/install/installCheck.php";
$tpl = new skinController();
$mysql = new mysqlConnection();
$method = new methodController();
$method->method_param("GET", "act,type");
/*
변수 처리
*/
if (!$type) {
$type = "new";
}
/*
수정 모드인 경우 기본 정보 로드
*/
if ($type == "modify") {
$mysql->select("\n\t\t\tSELECT *\n\t\t\tFROM toony_module_board_config\n\t\t\tWHERE board_id='{$act}'\n\t\t");
$mysql->fetchArray("write_point,read_point,skin,board_id,name,list_limit,length_limit,use_secret,use_comment,use_likes,use_category,category,use_reply,use_vote,use_file1,use_file2,use_list,file_limit,void_html,controll_level,write_level,read_level,secret_level,comment_level,array_level,reply_level,delete_level,top_file,bottom_file,thumb_width,thumb_height,articleIMG_width,articleIMG_height,article_length,ico_file,ico_mobile,ico_secret,ico_secret_def,ico_new,ico_new_def,ico_hot,ico_hot_def,tc_1,tc_2,tc_3,tc_4,tc_5");
$array = $mysql->array;
$mysql->htmlspecialchars = 0;
$mysql->nl2br = 0;
$array['top_source'] = $mysql->fetch("top_source");
$array['bottom_source'] = $mysql->fetch("bottom_source");
}
/*
홈페이지&모바일페이지 설정 값이 함께 기록되는 필드인 경우 분리
*/
$use_list_exp = explode("|", $array['use_list']);
$array['use_list'] = $use_list_exp[0];
$array['use_m_list'] = $use_list_exp[1];
示例8: header
<?php
header('Content-Type: application/json');
$rest_json = file_get_contents("php://input");
$_POST = json_decode($rest_json, true);
$_POST = parse_str($rest_json, $parameters);
$aResult = array();
include './model/mysqlConnection.php';
if ($parameters['arguments']['0'] == null) {
echo 'Wrong Parameters';
die;
// die('Wrong Parameters');
}
$query = "UPDATE tbl_people SET notify = 'No' where per_id = {$parameters['arguments']['0']}";
if (!($res = mysqlConnection::getConnection()->query($query))) {
die('There was an error running the query [' . $query->error . ']');
}
echo json_encode(array('id' => 3));
?>
示例9: skinController
<?php
$tpl = new skinController();
$header = new skinController();
$loop = new skinController();
$footer = new skinController();
$mysql = new mysqlConnection();
$lib = new libraryClass();
$paging = new pagingClass();
$method = new methodController();
$method->method_param("GET", "page,where,keyword");
/*
검색 키워드 설정
*/
if (trim($keyword) != "") {
$array_where = $where . " LIKE '%" . $keyword . "%'";
} else {
$array_where = "1";
}
/*
페이징 설정
*/
$paging_query = "\n\t\tSELECT *\n\t\tFROM toony_admin_security_member\n\t\tWHERE {$array_where}\n\t\tORDER BY regdate DESC\n\t";
$mysql->select($paging_query);
$paging_query_no = $mysql->numRows();
$paging->page_param($page);
$total_num = $paging->setTotal($paging_query_no);
$paging->setListPerPage(10);
$sql = $paging->getPaggingQuery($paging_query);
$mysql->select($sql);
$array_total = $mysql->numRows();
示例10: skinController
<?php
$tpl = new skinController();
$lib = new libraryClass();
$mysql = new mysqlConnection();
/*
검사
*/
if ($member['me_admin'] != "Y") {
$lib->error_alert_location("접근 권한이 없습니다.", $site_config[ad_site_url], "A");
}
/*
최고 운영자 기본 정보 로드
*/
$mysql->select("\n\t\tSELECT *\n\t\tFROM toony_member_list\n\t\tWHERE me_admin='Y' AND me_level=1\n\t");
$mysql->fetchArray("me_id,me_nick,me_sex,me_phone,me_telephone,me_password,me_point");
$array = $mysql->array;
/*
템플릿 로드
*/
$tpl->skin_file_path("admin/_tpl/adminInfo.html");
/*
템플릿 함수
*/
function sex_checked_value_func($obj)
{
global $array;
switch ($array['me_sex']) {
case "M":
if ($obj == "M") {
return "checked";
示例11: libraryClass
<?php
include "../include/engine.inc.php";
include __DIR_PATH__ . "include/global.php";
$lib = new libraryClass();
$mysql = new mysqlConnection();
$method = new methodController();
$fileUploader = new fileUploader();
$validator = new validator();
$method->method_param("POST", "href,depth,parent,forward,callName,type,org,module,page,name,class,title_img_ed,img_ed,img2_ed,del_title_img,del_img,del_img2,link,linkDoc,vtype,useMenu,useMenu_header_val,useMenu_side,useMenu_side_val");
$method->method_param("FILE", "title_img,img,img2");
$lib->security_filter("referer");
$lib->security_filter("request_get");
/*
변수 처리
*/
if (!$vtype) {
$vtype = "p";
}
if ($useMenu_side_val == "disabled" || $useMenu_side == "checked") {
$useMenu_side = "Y";
} else {
$useMenu_side = "N";
}
if ($useMenu_header_val == "disabled" || $useMenu == "checked") {
$useMenu = "Y";
} else {
$useMenu = "N";
}
/*
검사
示例12: libraryClass
<?php
include "../include/engine.inc.php";
include __DIR_PATH__ . "include/global.php";
$lib = new libraryClass();
$mysql = new mysqlConnection();
$method = new methodController();
$validator = new validator();
$method->method_param("POST", "skinType,skinName");
$lib->security_filter("referer");
$lib->security_filter("request_get");
/*
홈페이지, 모바일페이지를 구분하여 DB update 구문 작성
*/
if ($skinType == "p") {
$update = "ad_site_layout='{$skinName}'";
} else {
$update = "ad_msite_layout='{$skinName}'";
}
/*
DB수정
*/
$mysql->query("\n\t\tUPDATE toony_admin_siteconfig SET\n\t\t{$update}\n\t");
/*
완료후 리턴
*/
$validator->validt_success("성공적으로 반영 되었습니다.", "");
示例13: getmanfullrevall
function getmanfullrevall($manid)
{
//printf('manid: '.$manid.'');
//$cloud = mysql_query("SELECT man_id, title_orig, genre, notes, stat_id, per_id, datesubmitted FROM tbl_manuscript WHERE man_id=$manid") or die(mysql_error());
$query = "SELECT man_id, title_orig, genre, notes, stat_id, per_id, datesubmitted FROM tbl_manuscript WHERE man_id={$manid} ORDER by dateSubmitted ASC";
if (!($res = mysqlConnection::getConnection()->query($query))) {
die('There was an error running the query [' . $query->error . ']');
}
$num_rows = $res->num_rows;
if ($num_rows < 1) {
printf("You do not have any active reviews currently assigned.<br /> See the left hand menu for your options.");
} else {
// $arr = mysql_fetch_assoc($cloud);
$arr = $res->fetch_assoc();
$title = $arr['title_orig'];
$genre = $arr['genre'];
$notes = $arr['notes'];
$statid = $arr['stat_id'];
$submitted = $arr['datesubmitted'];
$perid = $arr['per_id'];
$author = authname($perid);
printf('
<div id="review" style="border-top:1px solid #ccc;">
<table>
<tr><td style="width:105px">Manuscript ref:</td><td>#' . $arr['man_id'] . '  <a href="reviewmanuscript.php?manid=' . $arr['man_id'] . '">My Review</a></td></tr>
<tr><td>Author:</td><td>' . $author . '</td></tr>
<tr><td>Title:</td><td>' . $title . '</td></tr>
<tr><td>Genre:</td><td>' . $genre . '</td></tr>
<tr><td>Notes:</td><td>' . $notes . '</td></tr>');
getstatus($arr['stat_id']);
printf('<tr><td>Date submitted:</td><td>' . $submitted . '</td></tr>
</table></div>');
}
}
示例14: libraryClass
<?php
include "../../../include/engine.inc.php";
include __DIR_PATH__ . "include/global.php";
$lib = new libraryClass();
$mysql = new mysqlConnection();
$method = new methodController();
$validator = new validator();
$method->method_param("POST", "type,board_id,skin,name,use_list,use_m_list,use_secret,use_comment,use_likes,use_reply,use_category,category,use_file1,use_file2,file_limit,list_limit,list_m_limit,length_limit,length_m_limit,array_level,write_level,secret_level,comment_level,delete_level,read_level,controll_level,reply_level,write_point,read_point,top_file,top_source,bottom_file,bottom_source,thumb_width,thumb_m_width,thumb_height,thumb_m_height,articleIMG_width,articleIMG_m_width,articleIMG_height,articleIMG_m_height,article_length,article_m_length,ico_file_p,ico_file_m,ico_mobile_p,ico_mobile_m,ico_secret_p,ico_secret_m,ico_secret_def,ico_new_p,ico_new_m,ico_new_def,ico_hot_def_v,ico_hot_def_r,ico_hot_def_type,ico_hot_p,ico_hot_m,tc_1,tc_2,tc_3,tc_4,tc_5");
$lib->security_filter("referer");
$lib->security_filter("request_get");
/*
검사
*/
if ($type == "new") {
$mysql->select("\n\t\t\tSELECT *\n\t\t\tFROM toony_module_board_config\n\t\t\tWHERE board_id='{$board_id}'\n\t\t");
if ($mysql->numRows() > 0) {
$validator->validt_diserror("board_id", "이미 존재하는 코드입니다.");
}
$validator->validt_idx("board_id", 1, "");
}
$validator->validt_null("name", "");
$validator->validt_number("list_limit", 1, 10, 1, "");
$validator->validt_number("list_m_limit", 1, 10, 1, "");
$validator->validt_number("length_limit", 1, 10, 1, "");
$validator->validt_number("length_m_limit", 1, 10, 1, "");
$validator->validt_number("file_limit", 1, 10, 1, "");
$validator->validt_number("article_length", 1, 10, 1, "");
$validator->validt_number("article_m_length", 1, 10, 1, "");
$validator->validt_number("write_point", 1, 10, 1, "");
$validator->validt_number("read_point", 1, 10, 1, "");
示例15: skinController
<?php
$tpl = new skinController();
$mysql = new mysqlConnection();
/*
레이아웃 스킨 템플릿 로드
*/
$tpl->skin_file_path("layoutskin/" . CALLED_LAYOUTDIR . "sub.html");
/*
서브페이지 네비게이션 선언
*/
if (CALLED_DEPTH == 1) {
$where = "callName='" . CALLED_ARTICLE . "'";
} else {
if (CALLED_DEPTH == 2) {
$where = "(callName='" . CALLED_ARTICLE . "') OR (class='" . CALLED_CLASS . "' AND depth=1)";
} else {
if (CALLED_DEPTH == 3) {
$where = "(callName='" . CALLED_ARTICLE . "') OR (class='" . CALLED_CLASS . "' AND depth=1) OR (idno='" . CALLED_PARENT . "' AND depth=2)";
}
}
}
$mysql->select("\n\t\tSELECT *\n\t\tFROM toony_admin_menuInfo\n\t\tWHERE vtype='" . CALLED_VIEWTYPE . "' AND drop_regdate IS NULL AND ({$where})\n\t\tORDER BY depth ASC\n\t");
$naviTxt = "<a href=\"{$site_config['ad_site_url']}" . CALLED_VIEWDIR . "\">{$site_config['ad_site_name']}</a>";
//depth가 1인 경우 1차 메뉴 출력
if (CALLED_DEPTH == 1) {
$naviTxt .= " > <a href=\"?article=" . $mysql->fetch("callName") . "\">" . $mysql->fetch("name") . "</a>";
//depth가 2 이상인 경우 2차 메뉴 출력
} else {
do {
$naviTxt .= " > <a href=\"?article=" . $mysql->fetch("callName") . "\">" . $mysql->fetch("name") . "</a>";