本文整理匯總了PHP中sql_db::re_datas方法的典型用法代碼示例。如果您正苦於以下問題:PHP sql_db::re_datas方法的具體用法?PHP sql_db::re_datas怎麽用?PHP sql_db::re_datas使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sql_db
的用法示例。
在下文中一共展示了sql_db::re_datas方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: explode
$name = explode('_', $_POST['ModuleUrlName']);
for ($i = 0, $len = count($name); $i < $len; $i++) {
if ($i == 0) {
$name[$i] = strtolower($name[$i]);
} else {
$name[$i] = ucfirst(strtolower($name[$i]));
}
}
$_SESSION['ModuleVarName'] = implode('', $name);
$_SESSION['ModuleFileName'] = ucfirst($_SESSION['ModuleVarName']);
$_SESSION['TableName'] = $_POST['TableName'];
$_SESSION['PageNum'] = $_POST['PageNum'];
include_once "../admin/class/sql.inc.php";
$mysql = new sql_db($_SESSION['host'], $_SESSION['user'], $_SESSION['pwd'], $_SESSION['dbname']);
$sql = "show full fields from `" . $_SESSION['TableName'] . "`";
$rs = $mysql->re_datas($sql);
$str = "";
$i = 0;
$type_option = '<option value="">不檢查</option>
<option value="mobile">手機</option>
<option value="number">數字</option>
<option value="email">郵箱</option>
<option value="year">年份</option>
<option value="month">月份</option>
<option value="day">日期</option>
<option value="image">有效圖片地址</option>
<option value="url">URL地址</option>
<option value="postcode">郵編</option>
<option value="resource">有效HTTP資源</option>
<option value="datatime">日期時間</option>
<option value="idcard">身份證</option>
示例2: strtolower
for ($i = 0, $len = count($name); $i < $len; $i++) {
if ($i == 0) {
$name[$i] = strtolower($name[$i]);
} else {
$name[$i] = ucfirst(strtolower($name[$i]));
}
}
$_SESSION['ModuleVarName'] = implode('', $name);
$_SESSION['ModuleFileName'] = ucfirst($_SESSION['ModuleVarName']);
$_SESSION['TableName'] = $_POST['TableName'];
$_SESSION['PageNum'] = $_POST['PageNum'];
include_once "./class/sql.inc.php";
$mysql = new sql_db($_SESSION['host'], $_SESSION['user'], $_SESSION['pwd'], $_SESSION['dbname']);
$mysql->sql_query("SET NAMES UTF8");
$sql = "show full fields from `" . $_SESSION['TableName'] . "`";
$rs = $mysql->re_datas($sql);
$sql = "show index from `" . $_SESSION['TableName'] . "`";
$showIndex = $mysql->re_datas($sql);
$primaryFieldArr = array();
foreach ($showIndex as $v) {
if ($v['Key_name'] == 'PRIMARY') {
$primaryFieldArr[] = $v['Column_name'];
}
}
if (!empty($primaryFieldArr)) {
$priTd = ' style="display:none;"';
}
$str = "";
$i = 0;
$type_option = '<option value="">不檢查</option>
<option value="mobile">手機</option>