本文整理汇总了PHP中fetchtablelist函数的典型用法代码示例。如果您正苦于以下问题:PHP fetchtablelist函数的具体用法?PHP fetchtablelist怎么用?PHP fetchtablelist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetchtablelist函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sql_run
if ($admin_runquery) {
$result = sql_run($_POST['sql_content']);
if ($result) {
flash("success");
} else {
flash();
}
} else {
flash("admin_runquery_forbidden");
}
}
if ($do == "backup") {
$filename = date('ymd') . '_' . pb_radom(6);
$db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
$time = gmdate("M d Y H:i:s", mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")));
$tables = arraykeys2(fetchtablelist($tb_prefix), 'Name');
if (mysql_get_server_info() > '4.1') {
$db->query("set names '" . $dbcharset . "'");
}
$backupfilename = DATA_PATH . "backup_" . $backupdir . DS . str_replace(array('/', '\\', '.'), '', $filename);
$sqldump = '';
$tableid = 0;
$startfrom = 0;
for (; $tableid < count($tables); $tableid++) {
$sqldump .= sqldumptable($tables[$tableid], $startfrom, strlen($sqldump));
$startfrom = 0;
}
$dumpfile = $backupfilename . '.sql';
$tableid--;
if (trim($sqldump)) {
$fp = file_put_contents($dumpfile, $sqldump);
示例2: getval
$sqlcharset = getval('sqlcharset');
$extendins = getval('extendins');
$sqlcompat = getval('sqlcompat');
$usehex = intval(getval('usehex'));
$_SGLOBAL['db']->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
//Error-free execution off the table and I create a column without quotes
if (empty($filename) || strlen($filename) > 40) {
//Determine the length of the file name
cpmessage('documents_were_incorrect_length');
} else {
$filename = preg_replace("/[^a-z0-9_]/i", '', str_replace('.', '_', $filename));
}
$tables = array();
// backup mode
if ($type == 'uchomes') {
$tables = arraykeys2(fetchtablelist($tablepre), 'Name');
} elseif ($type == 'custom') {
if (isset($_POST['setup'])) {
//POST submit backup
$tables = empty($_POST['customtables']) ? array() : $_POST['customtables'];
data_set('custombackup', $tables);
} else {
//Jump backup automatically
$tables = data_get('custombackup');
$tables = unserialize($tables);
}
}
if (empty($tables) || !is_array($tables)) {
cpmessage('backup_table_wrong');
}
$time = sgmdate('Y-m-d H:i:s', $_SGLOBAL['timestamp']);
示例3: function_exists
\t\t</tr>
\t\t</table>
\t</td>
\t</tr>
\t</table>
END;
//备份
if ($op == 'export') {
$shelldisabled = function_exists('shell_exec') ? '' : 'disabled';
$zipdisplay = function_exists('gzcompress') ? '' : 'style="display:none"';
$filename = date('ymd') . '_' . random(8);
$dbversion = intval($_SGLOBAL['db']->version());
$sqlcharsets = "<input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value=\"\" checked> {$alang['customfield_title_isdefault']}" . ($dbcharset ? " <input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value=\"{$dbcharset}\"> " . strtoupper($dbcharset) : '') . ($dbversion > '4.1' && $dbcharset != 'utf8' ? " <input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value='utf8'> UTF-8</option>" : '');
$tablelist = '';
//取得SupeSite表
$supe_tablelist = fetchtablelist($tablepre);
$rowcount = 0;
foreach ($supe_tablelist as $value) {
$tablelist .= ($rowcount % 4 ? '' : '</tr><tr>') . "<td><input type='checkbox' name='customtables[]' value='{$value['Name']}' checked>{$value['Name']}</td>\n";
$rowcount++;
}
$tablelist .= '</tr>';
$formhash = formhash();
print <<<END
\t<form method="post" action="{$theurl}&op=backupstart" enctype="multipart/form-data">
\t<input type="hidden" name="formhash" value="{$formhash}">
\t\t<table cellspacing="2" cellpadding="2" class="helptable"><tr><td>{$alang['database_export_help']}</td></tr></table>
\t\t<table cellspacing="0" cellpadding="0" width="100%" class="maintable">
\t\t\t<tr>
\t\t\t\t<th><input type="radio" name="type" value="supesite" checked onclick="\$('showtables').style.display='none'">{$alang['supesite_all_database']}</th>
\t\t\t</tr>
示例4: gmdate
<input class="button" type="submit" name="exportsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
$db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
if(!$filename || preg_match("/(\.)(exe|jsp|asp|aspx|cgi|fcgi|pl)(\.|$)/i", $filename)) {
cpmsg('database_export_filename_invalid');
}
$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
if($type == 'discuz') {
$tables = arraykeys2(fetchtablelist($tablepre), 'Name');
} elseif($type == 'discuzsupesite') {
$tables = arraykeys2(array_merge(fetchtablelist($tablepre), ($supe['tablepre'] ? fetchtablelist($supe['tablepre']) : array())), 'Name');
} elseif($type == 'custom') {
$tables = array();
if(empty($setup)) {
if($tables = $db->fetch_first("SELECT value FROM {$tablepre}settings WHERE variable='custombackup'")) {
$tables = unserialize($tables['value']);
}
} else {
$customtables= array_merge(empty($customtables) ? array() : $customtables, empty($supetables) ? array() : $supetables);
$customtablesnew = empty($customtables)? '' : addslashes(serialize($customtables));
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('custombackup', '$customtablesnew')");
$tables = & $customtables;
}
if( !is_array($tables) || empty($tables)) {
cpmsg('database_export_custom_invalid');
}
示例5: sprintf
$filename = sprintf($usezip == 2 ? $backupfilename."-%s".'.zip' : $dumpfile, $i);
$filelist .= "<li><a href=\"$filename\">$filename\n";
}
cpmsg('恭喜您,全部 '.$volume.' 个备份文件成功创建,备份完成。<a href="'.$phpself.'?action='.$action.'">数据备份</a><ul>'.$filelist.'</ul>');
}
}
}
}
$shelldisabled = function_exists('shell_exec') ? '' : 'disabled';
$sqlcharsets = "<input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value=\"\" checked> $lang[default]".($dbcharset ? " <input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value=\"$dbcharset\"> ".strtoupper($dbcharset) : '').($db->version() > '4.1' && $dbcharset != 'utf8' ? " <input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value='utf8'> UTF-8</option>" : '');
$tablelist = "";
$pnbak_tables = fetchtablelist('',1);
foreach($pnbak_tables as $key => $tables){
$rowcount =0;
$tablelist .="<tr>\n\t<td colspan=\"4\"><b>".(empty($key)?"其它":$key)."数据表</b> <input type=\"checkbox\" name=\"chkall\" onclick=\"exportcheckall(this,'".(empty($key)?"other_":$key)."')\" class=\"checkbox\" checked> <b>全选</b></td>\n</tr>\n";
$tablelist .= "<tbody id=\"".(empty($key)?"other_":$key)."\">";
foreach($tables as $table) {
$tablelist .= ($rowcount % 4 ? '' : "<tr>")."\n\t<td><input class=\"checkbox\" type=\"checkbox\" name=\"customtables[]\" value=\"$table[Name]\" checked> $table[Name]</td>".($rowcount % 4!=3 ? '' : "\n</tr>\n");
$rowcount++;
}
$i = $rowcount%4==0?0:(4-$rowcount%4);
for(; $i>0;$i--){
$tablelist .= ($rowcount % 4 ? '' : "<tr>")."\n\t<td> </td>".($rowcount % 4!=3 ? '' : "\n</tr>\n");
$rowcount++;
}
$tablelist .= "</tbody>";
}