当前位置: 首页>>代码示例>>PHP>>正文


PHP model::database方法代码示例

本文整理汇总了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);
 }
开发者ID:tinyMrChaos,项目名称:hephaestus,代码行数:19,代码来源:movie.php

示例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);
}
开发者ID:hastigoswami,项目名称:cloudzon,代码行数:22,代码来源:suppo.php

示例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);
}
开发者ID:hastigoswami,项目名称:cloudzon,代码行数:28,代码来源:control2.php

示例4: database

 public function database()
 {
     $model = new model(5);
     $model->database();
     $model->view();
 }
开发者ID:raa07,项目名称:engine,代码行数:6,代码来源:controller.php


注:本文中的model::database方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。