本文整理匯總了PHP中MSD_query函數的典型用法代碼示例。如果您正苦於以下問題:PHP MSD_query函數的具體用法?PHP MSD_query怎麽用?PHP MSD_query使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MSD_query函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ExportHTML
function ExportHTML()
{
global $sql, $config, $lang;
$header = implode("", file($config['paths']['config'] . 'html_template'));
$header = str_replace("{TITLE}", 'MSD HTML-Export', $header);
$footer = "\n\n</body>\n</html>";
$content = "";
$content .= '<h1>Datenbank ' . $sql['export']['db'] . '</h1>';
$time_start = time();
if (!isset($config['dbconnection'])) {
MSD_mysql_connect();
}
for ($table = 0; $table < count($sql['export']['tables']); $table++) {
$content .= '<h2>Tabelle ' . $sql['export']['tables'][$table] . '</h2>' . "\n";
$fsql = "show fields from `" . $sql['export']['tables'][$table] . "`";
$dsql = "select * from `" . $sql['export']['tables'][$table] . "`";
//Struktur
$res = MSD_query($fsql) or die(SQLError($fsql, mysql_error()));
if ($res) {
$field = $fieldname = $fieldtyp = array();
$structure = "<table class=\"Table\">\n";
$numfields = mysql_numrows($res);
for ($feld = 0; $feld < $numfields; $feld++) {
$row = mysql_fetch_row($res);
$field[$feld] = $row[0];
if ($feld == 0) {
$structure .= "<tr class=\"Header\">\n";
for ($i = 0; $i < count($row); $i++) {
$str = mysql_fetch_field($res, $i);
$fieldname[$i] = $str->name;
$fieldtyp[$i] = $str->type;
$structure .= "<th>" . $str->name . "</th>\n";
}
$structure .= "</tr>\n<tr>\n";
}
for ($i = 0; $i < count($row); $i++) {
$structure .= "<td class=\"Object\">" . ($row[$i] != "" ? $row[$i] : " ") . "</td>\n";
}
$structure .= "</tr>\n";
}
$structure .= "</table>\n";
}
if ($sql['export']['htmlstructure'] == 1) {
$content .= "<h3>Struktur</h3>\n" . $structure;
}
//Daten
$res = MSD_query($dsql) or die(SQLError($dsql, mysql_error()));
if ($res) {
$anz = mysql_num_rows($res);
$content .= "<h3>Daten ({$anz} Datensätze)</h3>\n";
$content .= "<table class=\"Table\">\n";
for ($feld = 0; $feld < count($field); $feld++) {
if ($feld == 0) {
$content .= "<tr class=\"Header\">\n";
for ($i = 0; $i < count($field); $i++) {
$content .= "<th>" . $field[$i] . "</th>\n";
}
$content .= "</tr>\n";
}
}
for ($d = 0; $d < $anz; $d++) {
$row = mysql_fetch_row($res);
$content .= "<tr>\n";
for ($i = 0; $i < count($row); $i++) {
$content .= '<td class="Object">' . ($row[$i] != "" ? $row[$i] : " ") . "</td>\n";
}
$content .= "</tr>\n";
}
}
$content .= "</table>";
}
CSVOutput($header . $content . $footer);
}
示例2: Fieldlist
function Fieldlist($db, $tbl)
{
$fl = '';
$res = MSD_query("SHOW FIELDS FROM `{$db}`.`{$tbl}`;");
if ($res) {
$fl = '(';
for ($i = 0; $i < mysql_num_rows($res); $i++) {
$row = mysql_fetch_row($res);
$fl .= '`' . $row[0] . '`,';
}
$fl = substr($fl, 0, strlen($fl) - 1) . ')';
}
return $fl;
}
示例3: count
$sql_temp = 'SELECT count(*) as anzahl ' . substr($sql['sql_statement'], $pos, strlen($sql['sql_statement']) - $pos);
$res = @MSD_query($sql_temp, false);
if ($res) {
if ($row = mysql_fetch_object($res)) {
$numrowsabs = $row->anzahl;
}
} else {
// Query ergab Fehler - Anzahl unbekannt; -1 übernimmt dann die Groesse des Resultsets
$numrowsabs = -1;
}
}
}
}
$sqltmp = $sql['sql_statement'] . $sql['order_statement'] . (strpos(strtolower($sql['sql_statement'] . $sql['order_statement']), ' limit ') ? '' : $limit);
if (!$skip_mysql_execution) {
$res = MSD_query($sqltmp);
}
$numrows = @mysql_num_rows($res);
if ($numrowsabs == -1) {
$numrowsabs = $numrows;
}
if ($limitende > $numrowsabs) {
$limitende = $numrowsabs;
}
if ($numrowsabs > 0 && $Anzahl_SQLs <= 1) {
if ($showtables == 0) {
$command_line = $lang['L_INFO_RECORDS'] . " " . ($limitstart + 1) . " - ";
if ($limitstart + $limitende > $numrowsabs) {
$command_line .= $numrowsabs;
} else {
$command_line .= $limitstart + $limitende;
示例4: MSD_query
echo '<td align="center">' . ($row['Non_unique'] == 1 ? $lang['L_YES'] : $lang['L_NO']) . '</td>';
echo '<td>' . ($row['Cardinality'] >= 0 ? $row['Cardinality'] : $lang['L_NO']) . '</td>';
echo '<td>' . $row['Column_name'] . '</td>';
echo '</tr>';
}
}
echo '</table><br><input type="Button" value="' . $lang['L_SQL_CREATEINDEX'] . '" onclick="location.href=\'' . $p . '&sql_createindex=1\'" class="Formbutton">';
///// DH
if (isset($_GET['sql_createindex']) && $_GET['sql_createindex'] == "1") {
echo '<form action="' . $p . '" method="POST">';
echo '<h6>' . $lang['L_SETPRIMARYKEYSFOR'] . ' `' . $table_edit_name . '`</h6>';
//kopf
echo '<table class="bdr"><tr class="thead"><th>' . $lang['L_PRIMARYKEY_FIELD'] . '</th></tr>';
//body
$sqlFelder = "DESCRIBE `" . $databases['Name'][$dbid] . "`.`" . $_GET['tablename'] . "`;";
$res = MSD_query($sqlFelder);
$num = mysql_numrows($res);
if ($num == 0) {
echo '<tr><td>' . $lang['L_SQL_TABLENOINDEXES'] . '</td></tr>';
} else {
//alle Felder holen
$feldArray = array();
while ($row = mysql_fetch_array($res)) {
$feldArray[$row['Field']] = $row['Type'];
}
//Primaerschluessel holen, um automatisch vorzuselektieren
$primaryKeys = getPrimaryKeys($databases['Name'][$dbid], $_GET['tablename']);
//eine Select-Box pro Feld anzeigen
for ($i = 0; $i < $num; $i++) {
$cl = $i % 2 ? "dbrow" : "dbrow1";
echo '<tr class="' . $cl . '">';
示例5: killKey
function killKey($db, $table, $indexName)
{
$sqlKillKey = "ALTER TABLE `" . $db . "`.`" . $table . "` DROP INDEX `" . $indexName . "`";
$res = MSD_query($sqlKillKey);
return $res;
}
示例6: setNewPrimaryKeys
function setNewPrimaryKeys($db, $table, $newKeys)
{
$sqlSetNewPrimaryKeys = "ALTER TABLE `" . $db . "`.`" . $table . "` DROP PRIMARY KEY";
//wenn min. 1 Schluessel im Array, sonst nur loeschen
if (count($newKeys) > 0) {
$sqlSetNewPrimaryKeys .= ",\r\n\t\t\tADD PRIMARY KEY (`" . implode("`,`", $newKeys) . "`)";
}
$sqlSetNewPrimaryKeys .= ";";
$res = MSD_query($sqlSetNewPrimaryKeys);
return $res;
}
示例7: sprintf
$aus .= '<p class="success">' . sprintf($lang['L_SQL_RECORDDELETED'], $rk) . '</p>';
}
}
if ($mode == "empty") {
if ($showtables != 0) {
$sqlk = "TRUNCATE `{$rk}`";
$res = MSD_query($sqlk);
$aus .= '<p class="success">' . sprintf($lang['L_SQL_TABLEEMPTIED'], $rk) . '</p>';
}
}
if ($mode == "emptyk") {
if ($showtables != 0) {
$sqlk = "TRUNCATE `{$rk}`;";
$res = MSD_query($sqlk);
$sqlk = "ALTER TABLE `{$rk}` AUTO_INCREMENT=1;";
$res = MSD_query($sqlk);
$aus .= '<p class="success">' . sprintf($lang['L_SQL_TABLEEMPTIEDKEYS'], $rk) . '</p>';
}
}
$javascript_switch = '<script language="javascript" type="text/javascript">
function switch_area(textarea)
{
var t=document.getElementById(\'area_\'+textarea);
var c=document.getElementById(\'null_\'+textarea);
if (c.checked==true) { t.className="off";t.disabled=true; }
else { t.className="";t.disabled=false; }
}
</script>';
if ($mode == 'edit' || $mode == 'searchedit') {
include './inc/sqlbrowser/sql_record_update_inputmask.php';
}
示例8: trim
$newname = trim($_POST['db_create']);
if (!empty($newname)) {
$sqlc = "CREATE DATABASE `{$newname}`";
$col = MSD_NEW_VERSION ? $_POST['db_collate'] : "";
if (isset($_POST['db_default_charset']) && intval(substr(MSD_NEW_VERSION, 0, 1)) > 3) {
$db_default_charset_string = $config['mysql_possible_character_sets'][$_POST['db_default_charset']];
$db_default_charset = explode(' ', $db_default_charset_string);
if (isset($db_default_charset[0])) {
$sqlc .= ' DEFAULT CHARACTER SET `' . $db_default_charset[0] . '`';
}
}
$db_default_collation = @explode('|', $col);
if (isset($db_default_collation[1])) {
$sqlc .= ' COLLATE `' . $db_default_collation[1] . '`';
}
MSD_query($sqlc);
echo $lang['L_DB'] . " `{$newname}` " . $lang['L_SQL_WASCREATED'] . ".<br>";
SetDefault();
include $config['files']['parameter'];
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php?action=dbrefresh";</script>';
}
}
$db_action = $newname = "";
$db_index = -1;
for ($i = 0; $i < count($databases['Name']); $i++) {
if (isset($_POST['db_do_' . $i])) {
$newname = $_POST['db_rename' . $i];
$db_index = $i;
$db_action = $_POST['db_do_action_' . $i];
break;
}
示例9: isset
$sql['export']['namefirstline'] = isset($_POST['f_export_namefirstline' . $format]) ? $_POST['f_export_namefirstline' . $format] : 0;
$sql['export']['sendfile'] = $_POST['f_export_sendresult'];
$sql['export']['compressed'] = isset($_POST['f_export_compressed']) ? $_POST['f_export_compressed'] : 0;
$sql['export']['exportfile'] = "";
$sql['export']['xmlstructure'] = isset($_POST['f_export_xmlstructure']) ? $_POST['f_export_xmlstructure'] : 0;
$sql['export']['htmlstructure'] = isset($_POST['f_export_htmlstructure']) ? $_POST['f_export_htmlstructure'] : 0;
//ausgewählte Tabellen
if (isset($_POST['f_export_tables'])) {
$sql['export']['tables'] = $_POST['f_export_tables'];
}
} else {
CheckcsvOptions();
}
//Tabellenliste
$sqlt = "SHOW TABLE STATUS FROM `{$db}`";
$res = MSD_query($sqlt);
if ($res) {
$sql['export']['tablecount'] = mysqli_num_rows($res);
$sql['export']['recordcount'] = 0;
for ($i = 0; $i < $sql['export']['tablecount']; $i++) {
$row = mysqli_fetch_array($res);
$tblstr .= '<option value="' . $row['Name'] . '" ' . (isset($sql['export']['tables']) && in_array($row['Name'], $sql['export']['tables']) ? "selected" : "") . '>' . $row['Name'] . ' (' . $row['Rows'] . ')</option>' . "\n";
$sql['export']['recordcount'] += $row['Rows'];
}
}
$exaus = $aus . '<h4>' . sprintf($lang['L_SQL_EXPORT'], $databases['Name'][$dbid]) . '</h4>';
$exaus .= '<form action="sql.php?db=' . $db . '&dbid=' . $dbid . '&context=4" method="post">' . $nl;
$exaus .= '<a href="sql.php?db=' . $db . '&dbid=' . $dbid . '&context=4&import=1">' . $lang['L_IMPORT'] . '</a>';
$exaus .= '<h6>' . sprintf($lang['L_SQL_EXPORT'], $databases['Name'][$dbid]) . '</h6>';
$exaus .= '<table class="bdr"><tr class="thead"><th>' . $lang['L_TABLES'] . '</th>' . $nl;
$exaus .= '<th>' . $lang['L_EXPORTOPTIONS'] . '</th>';
示例10: get_sql_encodings
/**
* Receive all possible MySQL character sets and save standard to $config['mysql_standard_charset']
*/
function get_sql_encodings()
{
global $config;
unset($config['mysql_possible_character_sets']);
if (!isset($config['dbconnection'])) {
MSD_mysql_connect();
}
$erg = false;
$config['mysql_standard_character_set'] = '';
$config['mysql_possible_character_sets'] = array();
if (!defined('MSD_MYSQL_VERSION')) {
GetMySQLVersion();
}
$v = explode('.', MSD_MYSQL_VERSION);
$config['mysql_can_change_encoding'] = false;
if ($v[0] <= 4 && $v[1] < 1 || $v[0] <= 3) {
// MySQL < 4.1
$config['mysql_can_change_encoding'] = false;
$sqlt = 'SHOW VARIABLES LIKE \'character_set%\'';
$res = MSD_query($sqlt) or die(SQLError($sqlt, mysql_error()));
if ($res) {
while ($row = mysql_fetch_row($res)) {
if ($row[0] == 'character_set') {
$config['mysql_standard_character_set'] = $row[1];
if ($v[0] == 3) {
$config['mysql_possible_character_sets'][0] = $row[1];
}
}
if ($row[0] == 'character_sets' && $v[0] > 3) {
$config['mysql_possible_character_sets'] = explode(' ', $row[1]);
sort($config['mysql_possible_character_sets']);
}
}
}
} else {
// MySQL-Version >= 4.1
$config['mysql_can_change_encoding'] = true;
$sqlt = 'SHOW CHARACTER SET';
$res = MSD_query($sqlt) or die(SQLError($sqlt, mysql_error()));
if ($res) {
while ($row = mysql_fetch_row($res)) {
$config['mysql_possible_character_sets'][] = $row[0] . ' - ' . $row[1];
}
sort($config['mysql_possible_character_sets']);
}
$sqlt = 'SHOW VARIABLES LIKE \'character_set_connection\'';
$res = MSD_query($sqlt) or die(SQLError($sqlt, mysql_error()));
if ($res) {
while ($row = mysql_fetch_row($res)) {
$config['mysql_standard_character_set'] = $row[1];
}
}
}
}
示例11: MSDTemplate
<?php
// Edit record -> built Edit-Form
$tpl = new MSDTemplate();
$tpl->set_filenames(array('show' => './tpl/sqlbrowser/sql_record_update_inputmask.tpl'));
$target = $mode == "searchedit" ? '?mode=searchedit' : '?mode=update';
// jump back to search hit list after saving
$fields = getExtendedFieldInfo($db, $tablename);
$sqledit = "SELECT * FROM `{$tablename}` WHERE " . $recordkey;
$res = MSD_query($sqledit);
$record = mysqli_fetch_array($res, MYSQLI_ASSOC);
// get the record
$num = sizeof($record);
// get the nr of fields of the record
// iterate fields
$x = 0;
$fieldnames = '';
foreach ($record as $field => $fieldvalue) {
$fieldnames .= $field . '|';
$tpl->assign_block_vars('ROW', array('CLASS' => $x % 2 ? 1 : 2, 'FIELD_NAME' => $field, 'FIELD_VALUE' => my_quotes($fieldvalue), 'FIELD_ID' => correct_post_index($field)));
if ('YES' == $fields[$field]['null']) {
//field is nullable - precheck checkbox if value is null
$tpl->assign_block_vars('ROW.IS_NULLABLE', array('NULL_CHECKED' => is_null($fieldvalue) ? ' checked="checked"' : ''));
}
$type = strtoupper($fields[$field]['type']);
if (in_array($type, array('BLOB', 'TEXT'))) {
$tpl->assign_block_vars('ROW.IS_TEXTAREA', array());
} else {
$tpl->assign_block_vars('ROW.IS_TEXTINPUT', array());
}
$x++;
示例12: isset
$sql['export']['namefirstline'] = isset($_POST['f_export_namefirstline' . $format]) ? $_POST['f_export_namefirstline' . $format] : 0;
$sql['export']['sendfile'] = $_POST['f_export_sendresult'];
$sql['export']['compressed'] = isset($_POST['f_export_compressed']) ? $_POST['f_export_compressed'] : 0;
$sql['export']['exportfile'] = "";
$sql['export']['xmlstructure'] = isset($_POST['f_export_xmlstructure']) ? $_POST['f_export_xmlstructure'] : 0;
$sql['export']['htmlstructure'] = isset($_POST['f_export_htmlstructure']) ? $_POST['f_export_htmlstructure'] : 0;
//ausgewählte Tabellen
if (isset($_POST['f_export_tables'])) {
$sql['export']['tables'] = $_POST['f_export_tables'];
}
} else {
CheckcsvOptions();
}
//Tabellenliste
$sqlt = "SHOW TABLE STATUS FROM `{$db}`";
$res = MSD_query($sqlt) or die(SQLError($sqlt, mysql_error()));
if ($res) {
$sql['export']['tablecount'] = mysql_numrows($res);
$sql['export']['recordcount'] = 0;
for ($i = 0; $i < $sql['export']['tablecount']; $i++) {
$row = mysql_fetch_array($res);
$tblstr .= '<option value="' . $row['Name'] . '" ' . (isset($sql['export']['tables']) && in_array($row['Name'], $sql['export']['tables']) ? "selected" : "") . '>' . $row['Name'] . ' (' . $row['Rows'] . ')</option>' . "\n";
$sql['export']['recordcount'] += $row['Rows'];
}
}
$exaus = $aus . '<h4>' . sprintf($lang['sql_export'], $databases['Name'][$dbid]) . '</h4>';
$exaus .= '<form action="sql.php?db=' . $db . '&dbid=' . $dbid . '&context=4" method="post">' . $nl;
$exaus .= '<a href="sql.php?db=' . $db . '&dbid=' . $dbid . '&context=4&import=1">' . $lang['import'] . '</a>';
$exaus .= '<h6>' . sprintf($lang['sql_export'], $databases['Name'][$dbid]) . '</h6>';
$exaus .= '<table class="bordersmall"><tr class="thead"><th>' . $lang['tables'] . '</th>' . $nl;
$exaus .= '<th>' . $lang['exportoptions'] . '</th>';
示例13: trim
$newname = trim($_POST['db_create']);
if (!empty($newname)) {
$sqlc = "CREATE DATABASE `{$newname}`";
$col = MSD_NEW_VERSION ? $_POST['db_collate'] : "";
if (isset($_POST['db_default_charset']) && intval(substr(MSD_NEW_VERSION, 0, 1)) > 3) {
$db_default_charset_string = $config['mysql_possible_character_sets'][$_POST['db_default_charset']];
$db_default_charset = explode(' ', $db_default_charset_string);
if (isset($db_default_charset[0])) {
$sqlc .= ' DEFAULT CHARACTER SET `' . $db_default_charset[0] . '`';
}
}
$db_default_collation = @explode('|', $col);
if (isset($db_default_collation[1])) {
$sqlc .= ' COLLATE `' . $db_default_collation[1] . '`';
}
if (MSD_query($sqlc)) {
echo $lang['L_DB'] . " `{$newname}` " . $lang['L_SQL_WASCREATED'] . ".<br>";
SetDefault();
include $config['files']['parameter'];
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php?action=dbrefresh";</script>';
}
}
}
$db_action = $newname = "";
$db_index = -1;
for ($i = 0; $i < count($databases['Name']); $i++) {
if (isset($_POST['db_do_' . $i])) {
$newname = $_POST['db_rename' . $i];
$db_index = $i;
$db_action = $_POST['db_do_action_' . $i];
break;
示例14: ExportHTML
function ExportHTML()
{
global $sql, $config, $lang;
$header = '<html><head><title>MSD Export</title></head>';
$footer = "\n\n</body>\n</html>";
$content = "";
$content .= '<h1>' . $lang['L_DB'] . ' ' . $sql['export']['db'] . '</h1>';
$time_start = time();
if (!isset($config['dbconnection'])) {
MSD_mysql_connect();
}
for ($table = 0; $table < count($sql['export']['tables']); $table++) {
$content .= '<h2>Tabelle ' . $sql['export']['tables'][$table] . '</h2>' . "\n";
$fsql = "show fields from `" . $sql['export']['tables'][$table] . "`";
$dsql = "select * from `" . $sql['export']['tables'][$table] . "`";
//Struktur
$res = MSD_query($fsql);
if ($res) {
$field = $fieldname = $fieldtyp = array();
$structure = "<table class=\"Table\">\n";
$numfields = mysqli_num_rows($res);
for ($feld = 0; $feld < $numfields; $feld++) {
$row = mysqli_fetch_row($res);
$field[$feld] = $row[0];
if ($feld == 0) {
$structure .= "<tr class=\"Header\">\n";
for ($i = 0; $i < count($row); $i++) {
$str = ($___mysqli_tmp = mysqli_fetch_field_direct($res, 0)) && is_object($___mysqli_tmp) ? !is_null($___mysqli_tmp->primary_key = $___mysqli_tmp->flags & MYSQLI_PRI_KEY_FLAG ? 1 : 0) && !is_null($___mysqli_tmp->multiple_key = $___mysqli_tmp->flags & MYSQLI_MULTIPLE_KEY_FLAG ? 1 : 0) && !is_null($___mysqli_tmp->unique_key = $___mysqli_tmp->flags & MYSQLI_UNIQUE_KEY_FLAG ? 1 : 0) && !is_null($___mysqli_tmp->numeric = (int) ($___mysqli_tmp->type <= MYSQLI_TYPE_INT24 || $___mysqli_tmp->type == MYSQLI_TYPE_YEAR || (defined("MYSQLI_TYPE_NEWDECIMAL") ? $___mysqli_tmp->type == MYSQLI_TYPE_NEWDECIMAL : 0))) && !is_null($___mysqli_tmp->blob = (int) in_array($___mysqli_tmp->type, array(MYSQLI_TYPE_TINY_BLOB, MYSQLI_TYPE_BLOB, MYSQLI_TYPE_MEDIUM_BLOB, MYSQLI_TYPE_LONG_BLOB))) && !is_null($___mysqli_tmp->unsigned = $___mysqli_tmp->flags & MYSQLI_UNSIGNED_FLAG ? 1 : 0) && !is_null($___mysqli_tmp->zerofill = $___mysqli_tmp->flags & MYSQLI_ZEROFILL_FLAG ? 1 : 0) && !is_null($___mysqli_type = $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = $___mysqli_type == MYSQLI_TYPE_STRING || $___mysqli_type == MYSQLI_TYPE_VAR_STRING ? "type" : "") && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && in_array($___mysqli_type, array(MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_LONG, MYSQLI_TYPE_LONGLONG, MYSQLI_TYPE_INT24)) ? "int" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && in_array($___mysqli_type, array(MYSQLI_TYPE_FLOAT, MYSQLI_TYPE_DOUBLE, MYSQLI_TYPE_DECIMAL, defined("MYSQLI_TYPE_NEWDECIMAL") ? constant("MYSQLI_TYPE_NEWDECIMAL") : -1)) ? "real" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_TIMESTAMP ? "timestamp" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_YEAR ? "year" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && ($___mysqli_type == MYSQLI_TYPE_DATE || $___mysqli_type == MYSQLI_TYPE_NEWDATE) ? "date " : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_TIME ? "time" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_SET ? "set" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_ENUM ? "enum" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_GEOMETRY ? "geometry" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_DATETIME ? "datetime" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && in_array($___mysqli_type, array(MYSQLI_TYPE_TINY_BLOB, MYSQLI_TYPE_BLOB, MYSQLI_TYPE_MEDIUM_BLOB, MYSQLI_TYPE_LONG_BLOB)) ? "blob" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_NULL ? "null" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->type = "" == $___mysqli_tmp->type ? "unknown" : $___mysqli_tmp->type) && !is_null($___mysqli_tmp->not_null = $___mysqli_tmp->flags & MYSQLI_NOT_NULL_FLAG ? 1 : 0) : false ? $___mysqli_tmp : false;
$fieldname[$i] = $str->name;
$fieldtyp[$i] = $str->type;
$structure .= "<th>" . $str->name . "</th>\n";
}
$structure .= "</tr>\n<tr>\n";
}
for ($i = 0; $i < count($row); $i++) {
$structure .= "<td class=\"Object\">" . ($row[$i] != "" ? $row[$i] : " ") . "</td>\n";
}
$structure .= "</tr>\n";
}
$structure .= "</table>\n";
}
if ($sql['export']['htmlstructure'] == 1) {
$content .= "<h3>Struktur</h3>\n" . $structure;
}
//Daten
$res = MSD_query($dsql);
if ($res) {
$anz = mysqli_num_rows($res);
$content .= "<h3>Daten ({$anz} Datensätze)</h3>\n";
$content .= "<table class=\"Table\">\n";
for ($feld = 0; $feld < count($field); $feld++) {
if ($feld == 0) {
$content .= "<tr class=\"Header\">\n";
for ($i = 0; $i < count($field); $i++) {
$content .= "<th>" . $field[$i] . "</th>\n";
}
$content .= "</tr>\n";
}
}
for ($d = 0; $d < $anz; $d++) {
$row = mysqli_fetch_row($res);
$content .= "<tr>\n";
for ($i = 0; $i < count($row); $i++) {
$content .= '<td class="Object">' . ($row[$i] != "" ? $row[$i] : " ") . "</td>\n";
}
$content .= "</tr>\n";
}
}
$content .= "</table>";
}
CSVOutput($header . $content . $footer);
}
示例15: lock_table
function lock_table()
{
global $config, $restore;
if ($config["lock_tables"] == 1 && isset($restore["actual_table"]) && $restore["actual_table"] != "unbekannt") {
$sql = "LOCK TABLES `" . $restore["actual_table"] . "` WRITE";
$res = MSD_query($sql) || die(SQLError("Kein Lock ausgeführt!", mysql_error()));
}
}