本文整理匯總了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