本文整理汇总了PHP中conDB函数的典型用法代码示例。如果您正苦于以下问题:PHP conDB函数的具体用法?PHP conDB怎么用?PHP conDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了conDB函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: all_posts
function all_posts()
{
include "includes/db_con.inc";
$conn = conDB();
$query = "SELECT * FROM posts";
$posts = q($query);
return $posts;
}
示例2: find_post
function find_post($id)
{
include "includes/db_con.inc";
$conn = conDB();
$query = "SELECT * FROM posts where posts.id = '" . $id . "'";
$result = q($query);
$post = mysql_fetch_array($result);
return $post;
}
示例3: create_post
function create_post($title, $content)
{
//establish a database connection
include "includes/db_con.inc";
$conn = conDB();
//build an insert query
$query = sprintf("INSERT INTO posts (title, body, created, modified) VALUES('%s', '%s', '%s', '%s') ", mysql_real_escape_string($title), mysql_real_escape_string($content), date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
q($query);
//select the most recently created post
$result = q("SELECT id FROM posts ORDER BY posts.id DESC LIMIT 1");
$post = mysql_fetch_array($result);
//return the id of the last post
return $post['id'];
}
示例4: session_start
<?php
session_start();
include "phpconf.php";
include "func.php";
conDB();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>- - ÃкºÍÔ¹·ÃÒà¹çµ | <?php
echo " " . $Hospname . " ";
?>
| - - ÀÒÇÐâÀª¹Ò¡Òà ºÑªÕ 3áÅÐ4 - - |</title>
<style type="text/css">
<!--
body { margin: 0px 0px; padding: 0px 0px}
body{font-family:MS Sans Serif;font-size:10pt}
table,td{font-family:MS Sans Serif;font-size:10pt}
form{font-family:MS Sans Serif;font-size:10pt}
-->
</style>
<?php
//set theme
print "<link href='css/{$Theme}.css' rel='stylesheet' type='text/css'>";
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
示例5: getLocationName
function getLocationName($LID)
{
$conn = conDB();
$sql = "SELECT Name FROM locations WHERE IDKey='{$LID}'";
$result = mysqli_query($conn, $sql);
$row = $result->fetch_assoc();
$name = $row["Name"];
return $name;
}
示例6: session_start
<?php
//Initial Setup
session_start();
$_SESSION["servername"] = "localhost";
$_SESSION["Dusername"] = "web";
$_SESSION["Dpassword"] = "";
$_SESSION["dbname"] = "crm2";
$_SESSION["username"] = $_POST["user"];
$_SESSION["password"] = $_POST["pass"];
$_SESSION["idnum"] = 0;
$_SESSION["MINI"] = "0";
$_SESSION["DISPLAY"] = "1";
//Grant access to Core
include_once 'Core.php';
//Print out the header
NoSessionHeadprint();
$conn = conDB();
$user = $_SESSION["username"];
$pass = $_SESSION["password"];
$_SESSION["idnum"] = login($user, $pass);
$AID = $_SESSION["idnum"];
printUI($AID, "0", "0", FALSE);
//Print out the Tail section, possibly to be discontinued soon
TailPrint();
示例7: getIndexPermissions
function getIndexPermissions($IndexID)
{
$conn = conDB();
$sql = "SELECT PermIDV,PermIDE FROM cusindex WHERE IDKey='{$IndexID}'";
$result = mysqli_query($conn, $sql);
$row = $result->fetch_assoc();
$returns = array();
$returns[0] = $row["PermIDV"];
$returns[1] = $row["PermIDE"];
return $returns;
}