本文整理汇总了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');
}
}
示例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>';
示例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;
}
示例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