本文整理汇总了PHP中SQL::sqlDql方法的典型用法代码示例。如果您正苦于以下问题:PHP SQL::sqlDql方法的具体用法?PHP SQL::sqlDql怎么用?PHP SQL::sqlDql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQL
的用法示例。
在下文中一共展示了SQL::sqlDql方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SQL
<?php
require_once '../tool/openSql.class.php';
$sql = new SQL();
$select_studing = $sql->sqlDql('select * from studing');
while ($a = mysql_fetch_array($select_studing)) {
$b = array();
$b['id'] = $a['id'];
$b['name'] = $a['dataName'];
$b['content'] = $a['dataContent'];
echo '<div class="operate_data" data-id=' . $b['id'] . ' data-name=' . $b['name'] . ' data-content=' . $b['content'] . '></div>';
}
mysql_close();
?>
<div class='container'>
<header class='navbar navbar-default'>
<ul class='navbar-nav nav'>
<li>
<a class='navbar-brand' href='javascript:void(0);'>sySteam</a>
</li>
</ul>
<ul class='navbar-nav nav'>
<li ng-class='{active:bill.currentModel==0}' ng-click='bill.selectTypeStyle(0)'>
<a href='javascript:void(0);'>RemoveData</a>
</li>
<li ng-class='{active:bill.currentModel==1}' ng-click='bill.selectTypeStyle(1)'>
示例2: explode
$search_arr = explode(',', $searchArea);
if (count($search_arr) == 1) {
$search_table = $sql->sqlDivisionTable($searchArea);
} else {
// 非一张表的情况下
$search_table = array();
foreach ($search_arr as $value) {
$search_item = $sql->sqlDivisionTable($value);
array_push($search_table, $search_item);
}
}
// 表之间并没有任何关联 不能使用多表连接查询
$backArr = array();
for ($i = 0; $i < count($search_table); $i++) {
$search_dataTable = "select id,dataName,dataContent,dataDate,dataType from {$search_table[$i]} where dataName like '%{$searchValue}%' or dataContent like '%{$searchValue}%'";
$fetch = $sql->sqlDql($search_dataTable);
if (mysql_affected_rows() != -1) {
while ($b = mysql_fetch_array($fetch)) {
$a = array();
$a['id'] = $b['id'];
$a['name'] = $b['dataName'];
$a['content'] = $b['dataContent'];
$a['date'] = $b['dataDate'];
$a['type'] = $b['dataType'];
array_push($backArr, $a);
}
}
}
$sql->sqlClose();
$goBack = array('flag' => 1, 'data_array' => $backArr);
$goBack = json_encode($goBack);
示例3: die
$data_select = $_GET['data_select'];
$data_page = $_GET['data_page'];
} else {
die('<script>document.write("传输数据方式非法.");</script>;');
}
require_once '../tool/openSql.class.php';
$sql = new SQL();
$dataBase = $sql->sqlDivisionTable($data_select);
// 第一次 0
$data_page_start = $data_page * 30;
$statement = 'select * from ' . $dataBase . ' limit ' . "{$data_page_start},30";
$stateRows = 'select count(id) from ' . $dataBase;
if ($data_page != 0) {
//die($statement);
}
$result = $sql->sqlDql($statement);
$baseRows = $sql->sqlDql($stateRows);
while ($a = mysql_fetch_row($baseRows)) {
$base_rows = $a[0];
}
// 如果不存在数据 则 返回0
if ($base_rows == 0) {
echo 0;
mysql_close($link);
return '';
}
$arr = array();
while ($a = mysql_fetch_array($result)) {
$b = array();
$b['id'] = $a['id'];
$b['name'] = $a['dataName'];
示例4: die
<?php
if (isset($_GET['data_select'])) {
$data_select = $_GET['data_select'];
} else {
die('<script>document.write("传输数据方式非法.");</script>;');
}
require_once '../tool/openSql.class.php';
// sql 对象
$sql = new SQL();
// 分类过滤
$dataBase = $sql->sqlDivisionTable($data_select);
// 实际操作
$sql_expressment = 'select * from ' . $dataBase;
// 返回影响数据表行数
$result = $sql->sqlDql($sql_expressment);
$rows = mysql_affected_rows();
if (!$rows > 0) {
echo 0;
$sql->sqlClose($link);
return '';
}
$arr = array();
while ($a = mysql_fetch_array($result)) {
$b = array();
$b['id'] = $a['id'];
$b['name'] = $a['dataName'];
$b['content'] = $a['dataContent'];
array_push($arr, $b);
}
$json = json_encode($arr);