本文整理汇总了PHP中db_table_schema函数的典型用法代码示例。如果您正苦于以下问题:PHP db_table_schema函数的具体用法?PHP db_table_schema怎么用?PHP db_table_schema使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_table_schema函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: db_table_serialize
function db_table_serialize($db, $dbname)
{
$tables = $db->fetchall('SHOW TABLES');
if (empty($tables)) {
return '';
}
$struct = array();
foreach ($tables as $value) {
$structs[] = db_table_schema($db, substr($value['Tables_in_' . $dbname], strpos($value['Tables_in_' . $dbname], '_') + 1));
}
return iserializer($structs);
}
示例2: cloud_schema
function cloud_schema()
{
$pars = _cloud_build_params();
$pars['method'] = 'application.schema';
$dat = cloud_request('http://v2.addons.we7.cc/gateway.php', $pars);
$file = IA_ROOT . '/data/application.schema';
$ret = _cloud_shipping_parse($dat, $file);
if (!is_error($ret)) {
$schemas = array();
if (!empty($ret['schemas'])) {
load()->func('db');
foreach ($ret['schemas'] as $remote) {
$name = substr($remote['tablename'], 4);
$local = db_table_schema(pdo(), $name);
unset($remote['increment']);
unset($local['increment']);
if (empty($local)) {
$schemas[] = $remote;
} else {
$diffs = db_schema_compare($local, $remote);
if (!empty($diffs)) {
$schemas[] = $remote;
}
}
}
}
$ret['schemas'] = $schemas;
}
return $ret;
}
示例3: foreach
$packet['files'][] = "/stonefish_planting/template/userinfo.html";
$packet['files'][] = "/stonefish_planting/template/sharelist.html";
/*引导错误*/
$packet['files'][] = "/hx_donate/icon1111.jpg";
if ($step == 'schemas' && $_W['ispost']) {
$post = $_GPC['__input'];
$tablename = $post['table'];
foreach ($packet['schemas'] as $schema) {
if (substr($schema['tablename'], 4) == $tablename) {
$remote = $schema;
break;
}
}
if (!empty($remote)) {
load()->func('db');
$local = db_table_schema(pdo(), $tablename);
$sqls = db_table_fix_sql($local, $remote);
$error = false;
foreach ($sqls as $sql) {
if (pdo_query($sql) === false) {
$error = true;
$errormsg .= pdo_debug(false);
break;
}
}
if (!$error) {
exit('success');
}
}
exit;
}
示例4: load
}
}
exit;
}
load()->model('cloud');
$r = cloud_prepare();
if (is_error($r)) {
message($r['message'], url('cloud/profile'), 'error');
}
$upgrade = cloud_schema();
$schemas = $upgrade['schemas'];
if (!empty($schemas)) {
load()->func('db');
foreach ($schemas as $key => $value) {
$tablename = substr($value['tablename'], 4);
$struct = db_table_schema(pdo(), $tablename);
if (!empty($struct)) {
$temp = db_schema_compare($schemas[$key], $struct);
$diff[$tablename]['name'] = $value['tablename'];
if (!empty($temp['fields']['less'])) {
foreach ($temp['fields']['less'] as $key => $value) {
$diff[$tablename]['fields'][] = $value;
}
}
if (!empty($temp['indexes']['less'])) {
foreach ($temp['indexes']['less'] as $key => $value) {
$diff[$tablename]['indexes'][] = $value;
}
}
}
}