本文整理汇总了PHP中DB_CONNECT::getlink方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_CONNECT::getlink方法的具体用法?PHP DB_CONNECT::getlink怎么用?PHP DB_CONNECT::getlink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_CONNECT
的用法示例。
在下文中一共展示了DB_CONNECT::getlink方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/*
* Following code will get single job details
* A job is identified by job id (jobid)
*/
// array for JSON response
$response = array();
// check for post data
if (isset($_GET['jobid'])) {
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$con = new DB_CONNECT();
$jobid = safe($con->getlink(), $_GET['jobid']);
// get a job from products table
$result = mysqli_query($con->getlink(), "SELECT * FROM roster WHERE jobid = '{$jobid}'");
if (!empty($result)) {
// check for empty result
if (mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_array($result);
$job = array();
$job["jobid"] = $row["jobid"];
$job["jobstatus"] = $row["jobstatus"];
$job["comments"] = $row["comments"];
// user node
$response["job"] = array();
array_push($response["job"], $job);
// success
$response["success"] = 1;
// echoing JSON response
开发者ID:arvind-web-developer,项目名称:csharp-projects-BIT-server-side-android-app,代码行数:31,代码来源:get_job_details.php
示例2: array
<?php
/*
* Following code will delete a job from table
* A job is identified by request id (jobid)
*/
// array for JSON response
$response = array();
// check for required fields
if (isset($_POST['jobid'])) {
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$con = new DB_CONNECT();
$jobid = safe($con->getlink(), $_POST['jobid']);
// mysql update row with matched jobid
$result = mysqli_query($con->getlink(), "DELETE FROM roster WHERE jobid = '{$jobid}'");
// check if row deleted or not
if ($result) {
// successfully updated
$response["success"] = 1;
$response["message"] = "Job successfully deleted";
// echoing JSON response
echo json_encode($response);
} else {
// no job found
$response["success"] = 0;
$response["message"] = "No job found";
// echo no users JSON
echo json_encode($response);
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-BIT-server-side-android-app,代码行数:31,代码来源:delete_job.php
示例3: array
<?php
/*
* Following code will list all the products
*/
// array for JSON response
$response = array();
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$con = new DB_CONNECT();
// get all products from products table
$result = mysqli_query($con->getlink(), "SELECT * FROM roster");
// check for empty result
if (mysqli_num_rows($result) > 0) {
// looping through all results
// jobs node
////////*****$response["jobs"] = array();
//$response["jobs"] = array();
while ($row = mysqli_fetch_array($result)) {
// temp user array
$job = array();
$job["rid"] = $row["rid"];
$job["fname"] = $row["fname"];
$job["lname"] = $row["lname"];
$job["mphone"] = $row["mphone"];
$job["hphone"] = $row["hphone"];
$job["jobid"] = $row["jobid"];
$job["sch_start_date"] = $row["sch_start_date"];
$job["sch_start_time"] = $row["sch_start_time"];
$job["jobduration"] = $row["jobduration"];
开发者ID:arvind-web-developer,项目名称:csharp-projects-BIT-server-side-android-app,代码行数:31,代码来源:get_all_jobs.php
示例4: array
<?php
/*
* Following code will update a job information
* A job is identified by job id (jobid)
*/
// array for JSON response
$response = array();
// check for required fields
if (isset($_POST['jobid']) && isset($_POST['jobstatus']) && isset($_POST['comments'])) {
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$con = new DB_CONNECT();
$jobid = safe($con->getlink(), $_POST['jobid']);
$jobstatus = safe($con->getlink(), $_POST['jobstatus']);
$comments = safe($con->getlink(), $_POST['comments']);
// mysql update row with matched jobid
$result = mysqli_query($con->getlink(), "UPDATE roster \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET jobstatus = '{$jobstatus}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcomments = '{$comments}'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE jobid = '{$jobid}'");
// check if row inserted or not
if ($result) {
// successfully updated
$response["success"] = 1;
$response["message"] = "Job successfully updated.";
// echoing JSON response
echo json_encode($response);
} else {
//
}
} else {
// required field is missing
开发者ID:arvind-web-developer,项目名称:csharp-projects-BIT-server-side-android-app,代码行数:31,代码来源:update_job.php
示例5: array
<?php
/*
* Following code will create a new product row
* All product details are read from HTTP Post Request
*/
// array for JSON response
$response = array();
// check for required fields
if (isset($_POST['fname']) && isset($_POST['lname']) && isset($_POST['mphone']) && isset($_POST['hphone']) && isset($_POST['jobid']) && isset($_POST['sch_start_date']) && isset($_POST['sch_start_time']) && isset($_POST['jobduration']) && isset($_POST['act_start_date']) && isset($_POST['act_start_time']) && isset($_POST['act_end_date']) && isset($_POST['act_end_time']) && isset($_POST['jobstatus']) && isset($_POST['address']) && isset($_POST['comments'])) {
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$con = new DB_CONNECT();
$fname = safe($con->getlink(), $_POST['fname']);
$lname = safe($con->getlink(), $_POST['lname']);
$mphone = safe($con->getlink(), $_POST['mphone']);
$hphone = safe($con->getlink(), $_POST['hphone']);
$jobid = safe($con->getlink(), $_POST['jobid']);
$sch_start_date = safe($con->getlink(), $_POST['sch_start_date']);
$sch_start_time = safe($con->getlink(), $_POST['sch_start_time']);
$jobduration = safe($con->getlink(), $_POST['jobduration']);
$act_start_date = safe($con->getlink(), $_POST['act_start_date']);
$act_start_time = safe($con->getlink(), $_POST['act_start_time']);
$act_end_date = safe($con->getlink(), $_POST['act_end_date']);
$act_end_time = safe($con->getlink(), $_POST['act_end_time']);
$jobstatus = safe($con->getlink(), $_POST['jobstatus']);
$address = safe($con->getlink(), $_POST['address']);
$comments = safe($con->getlink(), $_POST['comments']);
// mysql inserting a new row
$result = mysqli_query($con->getlink(), "INSERT INTO roster (fname, lname, mphone, hphone, jobid, sch_start_date, sch_start_time, jobduration, act_start_date, act_start_time, act_end_date, act_end_time, jobstatus, address, comments) VALUES('{$fname}','{$lname}', '{$mphone}', '{$hphone}', '{$jobid}', '{$sch_start_date}', '{$sch_start_time}', '{$jobduration}', '{$act_start_date}', '{$act_start_time}', '{$act_end_date}', '{$act_end_time}', '{$jobstatus}', '{$address}', '{$comments}')");
开发者ID:arvind-web-developer,项目名称:csharp-projects-BIT-server-side-android-app,代码行数:31,代码来源:create_job.php