if (++$n % 50 === 0) { $db_tmp->ReConnect(false, $setting['db']['name']); } } $db_tmp->delete($setting['db']['pre_sub'] . "news_tag", array(array("count", "n<", 2), array("click", "n<", 5, "and"), array("add_date", "f<", "UNIX_TIMESTAMP()-60*60*24*10", "and"))); $db->Free(); $n = 1; $db->select($setting['db']['pre_sub'] . "news_tag", "id, tag"); while ($record = $db->GetRS()) { $counter = $db_tmp->result($setting['db']['pre_sub'] . "news_show", "count(*)", array("tag", "like", $record['tag'])); $db_tmp->update($setting['db']['pre_sub'] . "news_tag", array("count" => $counter), array("id", "n=", $record['id'])); if (++$n % 50 === 0) { $db_tmp->ReConnect(false, $setting['db']['name']); } } $db_tmp->Close(); unset($db_tmp); break; default: break; } if (!empty($log_info)) { write_log($log_info, "id={$id}"); $goto_url = $setting['info']['self'] . "?web_id=" . $web_id; } $mystep->pageEnd(false); function build_page($method) { global $mystep, $req, $db, $tpl, $tpl_info, $setting, $id, $web_id, $setting_sub; $tpl_info['idx'] = "art_tag"; $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
if ($prefix != 'kimai' && strlen($prefix) > 0 && !preg_match('/^[a-zA-Z0-9_]+$/', $prefix)) { $errors = true; $prefixErrorMessage = $lang == 'de' ? 'Nur Buchstaben, Zahlen und Unterstriche.' : 'Only letters, numbers and underscores.'; } if ($prefix != 'kimai' && strlen($prefix) > 64) { $errors = true; $prefixErrorMessage = $lang == 'de' ? 'Maximal 64 Zeichen.' : 'At most 64 characters.'; } if ($lang == 'de') { echo 'Möchten Sie einen Tabellen-Prefix vergeben?<br/>(Wenn Sie nicht wissen was das ist, lassen Sie einfach "kimai_" stehen)<br/><input id="prefix" type="text" value="' . htmlspecialchars($prefix) . '"/>'; } else { echo 'Would you like to assign a table-prefix?<br/>(If you don\'t know what this is - leave it as "kimai_")<br/><input id="prefix" type="text" value="' . htmlspecialchars($prefix) . '"/>'; } if (isset($prefixErrorMessage)) { echo '<strong id="prefix_label" class="arrow">' . $prefixErrorMessage . '</strong><br/><br/>'; } else { echo '<strong id="prefix_label"></strong><br/><br/>'; } echo '<br/><br/>'; if ($lang == 'de') { echo '<button onclick="step_back(); return false;">Zurück</button> <button onclick="db_check(); return false;" class="proceed">Fortfahren</button>'; } else { echo '<button onclick="step_back(); return false;">Back</button> <button onclick="db_check(); return false;" class="proceed">Proceed</button>'; } if ($database === '' && $create_database === '' || $errors || !isset($_REQUEST['redirect'])) { echo ob_get_clean(); } else { echo '<script type="text/javascript" charset="utf-8">db_proceed();</script>'; } $con->Close();
try { $filter["ALUNO_NOME"] = MySQL::SQLValue('%'); $db = new MySQL(); if (!$db) { echo " bd não instanciado! <br><br>"; } else { echo " bd instanciado.<br><br>"; } $db->SelectRows("ALUNO"); if ($db->RowCount() > 0) { echo "Conectado.<br><br><hr>"; } echo "<br>Tabela: aluno <p>"; echo $db->GetHTML(); echo '<br><br>'; $db->Close(); } catch (Exception $e) { echo "Erro: ", $e->getMessage(), "\n"; } echo "<hr>"; try { //$filter["ALUNO_NOME"] = MySQL::SQLValue('%'); //exibir tabela MATERIA echo "Tabela: materia <p>"; $db->SelectRows("MATERIA"); echo $db->GetHTML(); echo '<br><br>'; $db->Close(); } catch (Exception $e) { echo "Erro: ", $e->getMessage(), "\n"; }
<?php if (!isset($db_pesquisa)) { $db_pesquisa = new MySQL(); } $db_pesquisa->Query(" INSERT INTO PESQUISA(PESQUISA_PALAVRA) VALUES('" . $filtro_busca . "'); "); $db_pesquisa->Close();