當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Crud::read方法代碼示例

本文整理匯總了PHP中Crud::read方法的典型用法代碼示例。如果您正苦於以下問題:PHP Crud::read方法的具體用法?PHP Crud::read怎麽用?PHP Crud::read使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Crud的用法示例。


在下文中一共展示了Crud::read方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 public static function run($obj, $webClass)
 {
     if ($obj instanceof Model) {
         $cmd = isset($_GET['cmd']) ? addslashes($_GET['cmd']) : 'read';
         if ($cmd == "edit") {
             Crud::createForm($obj, $webClass);
             die;
         }
         if ($cmd == "add") {
             //Crud::createForm($obj,$webClass);
             $json = Crud::addPrecon($obj);
             die(json_encode($json));
         }
         if ($cmd == "delete") {
             $json['bool'] = 1;
             $id = isset($_POST['id']) ? addslashes($_POST['id']) : '';
             $json['bool'] = $obj->delete($id);
             die(json_encode($json));
         }
         if ($cmd == "ws") {
             Crud::workWebService($obj, $webClass);
             die;
         }
         Crud::read($obj, $webClass);
     } else {
         die('Crud hanya bisa dipakai dengan object Crud');
     }
 }
開發者ID:CapsuleCorpIndonesia,項目名稱:martabak_revolution,代碼行數:28,代碼來源:Crud.php

示例2: Crud

<?php

error_reporting(E_ALL);
ob_start("ob_gzhandler");
require_once 'CrudClass.php';
$read = new Crud();
$read->read();
echo '<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Squro tree</title>
    <link rel="stylesheet" href="squro.css">
    <script type="text/javascript" src="squro.js"></script>
</head>
<body>
<h1>Squro tree</h1><ul class="node">' . $read->show . '</ul></body>
</html>';
開發者ID:gennadiy-0612,項目名稱:squro,代碼行數:18,代碼來源:index.php

示例3: update

            echo "error:" . $sql . "<br>" . $conn->error;
        }
    }
    public function update()
    {
        $sql = " Update faqs SET answer ='woh'  WHERE id=1";
        if ($this->conn->query($sql) === TRUE) {
            echo "Record updated successfully";
        } else {
            echo "Error updating record: " . $conn->error;
        }
    }
    public function __destruct()
    {
        $this->conn->close();
    }
}
$crud = new Crud();
switch ($_GET['action']) {
    case "read":
        $crud->read();
        break;
    case "update":
        $crud->update();
        break;
    case "delete":
        break;
    case "insert":
        $crud->insert();
        break;
}
開發者ID:knguyen92990,項目名稱:crud,代碼行數:31,代碼來源:test.php

示例4: Crud

<?php 
include_once 'model.php';
$readInstantiate = new Crud();
$getData = $readInstantiate->read();
//var_dump($getData);
if (isset($_REQUEST['del_id'])) {
    $readInstantiate->delete($_REQUEST['del_id']);
    header("location : read.php");
}
?>
<table>
	<tr>
		<td>S.No.</td>
		<td>Name</td>
		<td>Address</td>
		<td>Phone</td>
		<td>Gender</td>
	</tr>
	<?php 
$i = 1;
?>
	<?php 
foreach ($getData as $key => $value) {
    ?>
	<tr>
		<td><?php 
    echo $i++;
    ?>
</td>
		<td><?php 
開發者ID:ocpyosep78,項目名稱:basicCrudInPhp,代碼行數:30,代碼來源:read.php


注:本文中的Crud::read方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。