本文整理汇总了PHP中model::database方法的典型用法代码示例。如果您正苦于以下问题:PHP model::database方法的具体用法?PHP model::database怎么用?PHP model::database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model::database方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_movie
function edit_movie($movie_id, $name, $year, $desc, $poster)
{
list($poster_id) = model::database()->safe_query('select poster from movie where movie_id=?', $movie_id);
$poster_file_id = $poster_id['poster'];
if (!empty($poster) && $poster['size'] > 0) {
if ($poster_file_id !== "") {
model::factory('file')->edit_file($poster_file_id, $poster['name'], 'Poster for ' . $name, $poster['type'], file_get_contents($poster['tmp_name']), model::factory('user')->instance()->getId());
} else {
$poster_file_id = model::file()->add_file($poster['name'], 'Poster for' . $name, $poster['type'], file_get_contents($poster['tmp_name']), model::user()->instance()->getId());
}
} else {
if (empty($poster_file_id)) {
$poster_file_id = $this->default_poster_id;
}
}
$params = array('name' => $name, 'description' => $desc, 'poster' => $poster_file_id, 'movie_id' => $movie_id, 'year' => $year);
$sql = 'update movie set name=:name, year=:year, description=:description, poster=:poster where movie_id=:movie_id';
model::factory('database')->safe_query($sql, $params);
}
示例2: model
<?php
include 'model.php';
$obj = new model();
header('Content-type: application/json');
$conn = $obj->database();
$name = $_POST['s_name'];
$company_name = $_POST['s_company_name'];
$email = $_POST['s_email'];
$phone = $_POST['s_phone'];
$web = $_POST['s_website'];
$assistance = $_POST['s_preferance'];
$message = $_POST['s_message'];
$conf = $obj->support($name, $company_name, $email, $phone, $web, $assistance, $message, $conn);
$conf = $obj->send_mail($name, $email, $message, $assistance, $company_name, $phone, $web);
if ($conf == 'done') {
$data = array('status' => 200, 'message' => "Your query has been sent successfully. We will contact you very soon.");
echo json_encode($data);
} else {
$data = array('status' => 400, 'message' => "Your query Not submitted successfully.");
echo json_encode($data);
}
示例3: model
<?php
include 'MVC/model.php';
session_start();
$obj2 = new model();
$conn = $obj2->database();
if (isset($_REQUEST['adminlogin'])) {
$name = $_REQUEST['adminname'];
$pass = $_REQUEST['adminpass'];
$data = $obj2->admin_login($conn, $name, $pass);
$ex = mysqli_num_rows($data);
if ($ex <= 0) {
header("location:admin.php");
} else {
$_SESSION["admin"] = $name;
header("location:Admindesk.php");
}
}
if (isset($_REQUEST['logoutname'])) {
unset($_SESSION["admin"]);
header("location:admin.php");
}
if (isset($_SESSION["admin"])) {
$resumeData = $obj2->show_resume($conn);
$enqData = $obj2->show_enq($conn);
$contactData = $obj2->show_contact_us($conn);
$itranscript_data = $obj2->show_itranscript_data($conn);
}
示例4: database
public function database()
{
$model = new model(5);
$model->database();
$model->view();
}