本文整理汇总了PHP中sql_db类的典型用法代码示例。如果您正苦于以下问题:PHP sql_db类的具体用法?PHP sql_db怎么用?PHP sql_db使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sql_db类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function &getServiceInstance($name, $servicedir = NULL)
{
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype;
static $instances = array();
static $db;
if (!isset($db)) {
require_once dirname(__FILE__) . '/../includes/db/' . $dbtype . '.php';
$db = new sql_db();
$db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist);
if (!$db->db_connect_id) {
message_die(CRITICAL_ERROR, "Could not connect to the database", $db);
}
}
if (!isset($instances[$name])) {
if (isset($serviceoverrules[$name])) {
$name = $serviceoverrules[$name];
}
if (!class_exists($name)) {
if (!isset($servicedir)) {
$servicedir = dirname(__FILE__) . '/';
}
require_once $servicedir . strtolower($name) . '.php';
}
$instances[$name] = call_user_func(array($name, 'getInstance'), $db);
}
return $instances[$name];
}
示例2: substr
$phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path = './../';
include $phpbb_root_path . 'config.' . $phpEx;
require $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx;
require $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx;
include $phpbb_root_path . 'includes/functions.' . $phpEx;
define('ACL_NEVER', 0);
define('ACL_YES', 1);
define('ACL_NO', -1);
define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups');
define('ACL_OPTIONS_TABLE', $table_prefix . 'acl_options');
define('ACL_USERS_TABLE', $table_prefix . 'acl_users');
define('GROUPS_TABLE', $table_prefix . 'groups');
define('USERS_TABLE', $table_prefix . 'users');
$cache = new acm();
$db = new sql_db();
// Connect to DB
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
// auth => is_local, is_global
$f_permissions = array('f_' => array(1, 0), 'f_list' => array(1, 0), 'f_read' => array(1, 0), 'f_post' => array(1, 0), 'f_reply' => array(1, 0), 'f_edit' => array(1, 0), 'f_user_lock' => array(1, 0), 'f_delete' => array(1, 0), 'f_bump' => array(1, 0), 'f_poll' => array(1, 0), 'f_vote' => array(1, 0), 'f_votechg' => array(1, 0), 'f_announce' => array(1, 0), 'f_sticky' => array(1, 0), 'f_attach' => array(1, 0), 'f_download' => array(1, 0), 'f_icons' => array(1, 0), 'f_bbcode' => array(1, 0), 'f_smilies' => array(1, 0), 'f_img' => array(1, 0), 'f_flash' => array(1, 0), 'f_sigs' => array(1, 0), 'f_search' => array(1, 0), 'f_email' => array(1, 0), 'f_print' => array(1, 0), 'f_ignoreflood' => array(1, 0), 'f_postcount' => array(1, 0), 'f_noapprove' => array(1, 0), 'f_report' => array(1, 0), 'f_subscribe' => array(1, 0));
$m_permissions = array('m_' => array(1, 1), 'm_edit' => array(1, 1), 'm_delete' => array(1, 1), 'm_move' => array(1, 1), 'm_lock' => array(1, 1), 'm_split' => array(1, 1), 'm_merge' => array(1, 1), 'm_approve' => array(1, 1), 'm_unrate' => array(1, 1), 'm_auth' => array(1, 1), 'm_ip' => array(1, 1), 'm_info' => array(1, 1));
$a_permissions = array('a_' => array(0, 1), 'a_server' => array(0, 1), 'a_board' => array(0, 1), 'a_clearlogs' => array(0, 1), 'a_words' => array(0, 1), 'a_icons' => array(0, 1), 'a_bbcode' => array(0, 1), 'a_attach' => array(0, 1), 'a_email' => array(0, 1), 'a_styles' => array(0, 1), 'a_user' => array(0, 1), 'a_useradd' => array(0, 1), 'a_userdel' => array(0, 1), 'a_ranks' => array(0, 1), 'a_ban' => array(0, 1), 'a_names' => array(0, 1), 'a_group' => array(0, 1), 'a_groupadd' => array(0, 1), 'a_groupdel' => array(0, 1), 'a_forum' => array(0, 1), 'a_forumadd' => array(0, 1), 'a_forumdel' => array(0, 1), 'a_prune' => array(0, 1), 'a_auth' => array(0, 1), 'a_authmods' => array(0, 1), 'a_authadmins' => array(0, 1), 'a_authusers' => array(0, 1), 'a_authgroups' => array(0, 1), 'a_authdeps' => array(0, 1), 'a_backup' => array(0, 1), 'a_restore' => array(0, 1), 'a_search' => array(0, 1), 'a_events' => array(0, 1), 'a_cron' => array(0, 1));
$u_permissions = array('u_' => array(0, 1), 'u_sendemail' => array(0, 1), 'u_readpm' => array(0, 1), 'u_sendpm' => array(0, 1), 'u_sendim' => array(0, 1), 'u_hideonline' => array(0, 1), 'u_viewonline' => array(0, 1), 'u_viewprofile' => array(0, 1), 'u_chgavatar' => array(0, 1), 'u_chggrp' => array(0, 1), 'u_chgemail' => array(0, 1), 'u_chgname' => array(0, 1), 'u_chgpasswd' => array(0, 1), 'u_chgcensors' => array(0, 1), 'u_search' => array(0, 1), 'u_savedrafts' => array(0, 1), 'u_download' => array(0, 1), 'u_attach' => array(0, 1), 'u_sig' => array(0, 1), 'u_pm_attach' => array(0, 1), 'u_pm_bbcode' => array(0, 1), 'u_pm_smilies' => array(0, 1), 'u_pm_download' => array(0, 1), 'u_pm_edit' => array(0, 1), 'u_pm_printpm' => array(0, 1), 'u_pm_emailpm' => array(0, 1), 'u_pm_forward' => array(0, 1), 'u_pm_delete' => array(0, 1), 'u_pm_img' => array(0, 1), 'u_pm_flash' => array(0, 1));
echo "<p><b>Determining existing permissions</b></p>\n";
$sql = 'SELECT auth_option_id, auth_option FROM ' . ACL_OPTIONS_TABLE;
$result = $db->sql_query($sql);
$remove_auth_options = array();
while ($row = $db->sql_fetchrow($result)) {
if (!in_array($row['auth_option'], array_keys(${substr($row['auth_option'], 0, 2) . 'permissions'}))) {
$remove_auth_options[$row['auth_option']] = $row['auth_option_id'];
}
示例3: array
if (defined('NV_IS_FLOOD_BLOCKER') and NV_IS_FLOOD_BLOCKER == 1 and !$nv_Request->isset_request('admin', 'session') and (!$nv_Request->isset_request('second', 'get') or $nv_Request->isset_request('second', 'get') and $client_info['is_myreferer'] != 1)) {
require_once NV_ROOTDIR . '/includes/core/flood_blocker.php';
}
//Xac dinh borwser cua client
$client_info['browser'] = $client_info['is_bot'] ? array('key' => "Unknown", 'name' => 'Unknown') : array_combine(array('key', 'name'), explode("|", nv_getBrowser(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/br.ini')));
//Xac dinh OS cua client
$client_info['client_os'] = $client_info['is_bot'] ? array('key' => "Robot", 'name' => $client_info['bot_info']['name']) : array_combine(array('key', 'name'), explode("|", nv_getOs(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/os.ini')));
//Captcha
if ($nv_Request->isset_request('scaptcha', 'get')) {
include_once NV_ROOTDIR . "/includes/core/captcha.php";
}
//Bat dau phien lam viec cua MySQL
require_once NV_ROOTDIR . '/includes/class/mysql.class.php';
$db_config['new_link'] = NV_MYSQL_NEW_LINK;
$db_config['persistency'] = NV_MYSQL_PERSISTENCY;
$db = new sql_db($db_config);
if (!empty($db->error)) {
$die = !empty($db->error['user_message']) ? $db->error['user_message'] : $db->error['message'];
$die .= !empty($db->error['code']) ? ' (Code: ' . $db->error['code'] . ')' : '';
trigger_error($die, 256);
}
unset($db_config['dbpass']);
//Ten cac table cua CSDL dung chung cho he thong
define('NV_AUTHORS_GLOBALTABLE', $db_config['prefix'] . '_authors');
define('NV_GROUPS_GLOBALTABLE', $db_config['prefix'] . '_groups');
define('NV_USERS_GLOBALTABLE', $db_config['prefix'] . '_users');
define('NV_SESSIONS_GLOBALTABLE', $db_config['prefix'] . '_sessions');
define('NV_LANGUAGE_GLOBALTABLE', $db_config['prefix'] . '_language');
define('NV_BANNERS_CLIENTS_GLOBALTABLE', $db_config['prefix'] . '_banners_clients');
define('NV_BANNERS_PLANS_GLOBALTABLE', $db_config['prefix'] . '_banners_plans');
define('NV_BANNERS_ROWS_GLOBALTABLE', $db_config['prefix'] . '_banners_rows');
示例4: page_header
$check_exts = 'mysql';
$check_other = 'mysql';
break;
case 'postgres':
$check_exts = 'pgsql';
$check_other = 'pgsql';
break;
}
if (!extension_loaded($check_exts) && !extension_loaded($check_other)) {
page_header($lang['Install'], '');
page_error($lang['Installer_Error'], $lang['Install_No_Ext']);
page_footer();
exit;
}
include $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx;
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
if (!$db->db_connect_id) {
message_die(CRITICAL_ERROR, "Could not connect to the database");
}
}
$dbms_schema = 'schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_schema.sql';
$dbms_basic = 'schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_basic.sql';
$remove_remarks = $available_dbms[$dbms]['COMMENTS'];
$delimiter = $available_dbms[$dbms]['DELIM'];
$delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC'];
if ($install_step == 1) {
if ($upgrade != 1) {
if ($dbms != 'msaccess') {
// Load in the sql parser
include $phpbb_root_path . 'includes/sql_parse.' . $phpEx;
// Ok we have the db info go ahead and read in the relevant schema
示例5: sql_db
<?php
include_once "login.php";
//print_r($_REQUEST);
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database");
}
$object = $_POST["obj"];
$id = $_POST["id"];
$azione = $_POST["action"];
$sql = "select distinct zona.nome_tavola as id from vincoli.zona left join vincoli.tavola on(zona.nome_tavola=tavola.nome_tavola) where zona.nome_vincolo= '{$id}' and tavola.cdu=1;";
$db->sql_query($sql);
print_debug($sql);
$ris = $db->sql_fetchrowset();
for ($i = 0; $i < count($ris); $i++) {
$out[] = "{id:'" . $ris[$i]["id"] . "',name:'" . $ris[$i]["id"] . "'}";
}
header("Content-Type: text/plain; Charset=UTF-8");
$debug = "{id:'{$object}',values:[" . implode(',', $out) . "]}";
print_debug($debug);
echo $debug;
示例6: dirname
{
define('IP_ROOT_PATH', dirname(dirname($argv[0])) . '/');
}
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
@set_time_limit(0);
@ini_set('memory_limit', '32M');
require(IP_ROOT_PATH . 'config.' . PHP_EXT);
define('SQL_LAYER', 'mysql4');
require(IP_ROOT_PATH . 'includes/db/mysql.' . PHP_EXT);
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
if(!$db->db_connect_id)
{
trigger_error('Database connection failed', E_USER_ERROR);
}
// HTML HEADER - BEGIN
echo("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
echo("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n");
echo("<head>\n");
echo("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n");
echo("<meta name=\"author\" content=\"Icy Phoenix Team\" />\n");
echo("<title>Icy Phoenix :: UTF-8 Conversion</title>\n");
echo("</head>\n");
echo("<body>\n");
echo("<div style=\"font-family: 'Lucida Grande', 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; font-size: 10px;\">\n");
示例7: sql_db
<?php
//if(!defined("comune")) return;
require_once "login.php";
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database");
}
$oggi = date("d-m-Y");
$dataoneri = date("d/m/Y");
$pratica = $_REQUEST['pratica'];
$sql = "SELECT numero,coalesce(data_prot,data_presentazione) as data from pe.avvioproc where pratica={$pratica}";
$db->sql_query($sql);
$numero = $db->sql_fetchfield('numero');
//$dataoneri=$db->sql_fetchfield('data');
$query = "SELECT * FROM oneri.parametri where '{$dataoneri}'::date BETWEEN datein AND coalesce(dateed,CURRENT_DATE);";
$result = $db->sql_query($query);
//if(!$result){echo "SQL Error - ".mysql_error()."<br>".$query;return;}
$row = $db->sql_fetchrow($result);
$costo_base = $row['costo_base'];
$qbase = $row['quota_base'];
$classe = $row['classe_comune'];
$quota = $row['corrispettivo'];
$delibera = $row['delibera'];
$sql = "SELECT case when (not coalesce(piva,'')='') then coalesce(ragsoc,'') else coalesce(cognome,'')||' '||coalesce(nome,'') end as nominativo FROM pe.soggetti WHERE richiedente=1 and pratica={$pratica};";
$db->sql_query($sql);
$ris = $db->sql_fetchlist('nominativo');
$nominativi = implode('; ', $ris);
$sql = "SELECT coalesce(via,'')||' '||coalesce(civico,'') as indirizzi FROM pe.indirizzi WHERE pratica={$pratica};";
$db->sql_query($sql);
$ris = $db->sql_fetchlist('indirizzi');
示例8: sql_db
<?php
if ($_POST["numero"]) {
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database");
}
$sql = "select id from pe.avvioproc where numero='" . $_POST["numero"] . "';";
$db->sql_query($sql);
$pratica = $db->sql_fetchfield("id");
if ($pratica) {
$sql = "\n\t\tDELETE FROM oneri.calcolati WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.fidi WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.monetizzazione WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.rate WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.totali WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.abitabi WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.allegati WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.asservimenti WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.asservimenti_map WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.avvioproc WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.cterreni WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.curbano WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.file_allegati WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.indirizzi WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.infodia WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.integrazioni WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.iter WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.lavori WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.menu WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.parametri_prog WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.pareri WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.progetto WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.proroga WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.soggetti WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.sopralluoghi WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.titolo WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.vincoli WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.volture WHERE PRATICA={$pratica};\n\t\t";
$result = $db->sql_query($sql);
if ($result) {
echo "pratica eliminata con successo";
}
}
}
示例9: sql_db
<?php
//Gestione della rateizzazione calcolo delle rate
//DA RIVEDERE LE GESTIONE DEI DATI STATICI es titolo
//DA PERSONALIZZARE SULLE ESIGENZE DEL COMUNE
//echo "calcolo della rateizzazione";
//print_r($_POST);
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database");
}
$campo_cc = $_POST["scade_cc"];
$campo_oneri = $_POST["scade_oneri"];
$tipo = trim($_POST["tipo"]);
$data_rata1 = $_POST["data_rata1"];
if ($campo_cc and $campo_oneri) {
$sql = "select titolo." . $campo_cc . " as scade_cc, titolo." . $campo_oneri . " as scade_oneri,monet,cc,(b1-scb1) as b1,(b2-scb2) as b2 from oneri.totali,pe.titolo where oneri.totali.pratica=pe.titolo.pratica and pe.titolo.pratica={$idpratica}";
if (!$db->sql_query($sql)) {
print_debug($sql);
}
//$db->sql_query($sql);
//echo "<p>$sql</p>";
//$db->sql_fetchrow();
}
$oneri = 1;
if ($oneri) {
$sql = "select * from oneri.e_rata_calcolo where tipo='{$tipo}' order by rata";
print_debug($sql);
if (!$db->sql_query($sql)) {
print_debug($sql);
}
示例10: elseif
$file = $db->sql_fetchfield('nome');
$form = $db->sql_fetchfield('form');
$testo = $db->sql_fetchfield('testohtml');
$css_modello = $db->sql_fetchfield('css_id');
$definizione = $db->sql_fetchfield('definizione');
$mess_css = $db->sql_fetchfield('css_desc');
$tipo = "modelli";
} elseif ($_REQUEST["mode"] == "new") {
$tipo = "modelli";
}
if ($_REQUEST["form"]) {
$form = $_REQUEST["form"];
}
if ($tipo == "modelli") {
/*SELEZIONE DELLE VISTE DAL DATABASE*/
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database");
}
$sql = "(SELECT 'Seleziona -->' as nome,'' as tipo,'Seleziona -->' as alias_nome,'' as descrizione,1 as ord) UNION (SELECT DISTINCT nome_vista as nome,tipo,alias_nome_vista,descrizione_vista,2 as ord FROM stp.colonne) order by ord,nome;";
$db->sql_query($sql);
$tables = $db->sql_fetchlist('nome');
$types = $db->sql_fetchlist('tipo');
$alias = $db->sql_fetchlist('alias_nome');
for ($i = 0; $i < count($tables); $i++) {
$value = $types[$i] . "." . $tables[$i];
$tmp = explode("_", $tables[$i]);
$str_name = ucwords($alias[$i]);
$print_options .= "\t\t\t\t\t\t\t\t\t<option value=\"{$value}\">{$str_name}</option>\n";
}
$sql = "SELECT CASE (tipo) WHEN 'FUNCTION' THEN 'FN_'||nome_vista ELSE nome_vista end as nome,nome as \t\tcolonna,alias_nome as alias_colonna,descrizione,visibile,tipo FROM stp.colonne WHERE visibile=1 order by nome_vista,nome;";
示例11: elseif
<?php
if ($_POST["azione"] == "Chiudi") {
$active_form = "clp.iter.php?comm_paesaggio=1&pratica={$idpratica}";
} elseif ($_POST["azione"] == "Elimina") {
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database " . DB_NAME);
}
$sql = "SELECT stampe from ce.iter where id=" . $_POST["idriga"];
$db->sql_query($sql);
$id_stampa = $db->sql_fetchfield("stampe");
$sql = "DELETE FROM stp.stampe WHERE id={$id_stampa};";
$db->sql_query($sql);
include_once "./db/db.savedata.php";
} else {
include_once "./db/db.savedata.php";
$sql = "UPDATE ce.iter SET nota=nota_edit WHERE id={$lastid};";
$db->sql_query($sql);
}
示例12: sql_db
?>
<html>
<head>
<title>Pratiche recenti</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<SCRIPT language="javascript" src="js/LoadLibs.js" type="text/javascript"></SCRIPT>
</head>
<body link="#0000FF" vlink="#0000FF" alink="#0000FF">
<?php
include "./inc/inc.page_header.php";
?>
<H2 class=blueBanner>Ultime pratiche aperte</H2>
<?php
$userid = $_SESSION["USER_ID"];
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al dadabase");
}
$db->sql_query("select pratica from pe.recenti where utente={$userid} order by data desc");
$elenco_pratiche = $db->sql_fetchlist("pratica");
$prat_max = count($elenco_pratiche);
if (!$elenco_pratiche) {
print "<p>Nessuna pratica aperta di recente dall'utente<p></body></html>";
exit;
}
$offset = 0;
include "pe.elenco_pratiche.php";
?>
<input name="" id="" class="hexfield1" type="button" value=" Chiudi " onClick="javascript:window.open('index.php','indexPraticaweb');window.close()"></td>
</BODY>
示例13: elseif
if ($ricerca["tipo_pratica"] == 1) {
$arr_cond[] = "report._tipo_pratica BETWEEN 11000 AND 11999";
} elseif ($ricerca["tipo_pratica"] == 2) {
$arr_cond[] = "report._tipo_pratica BETWEEN 10000 AND 10999";
} elseif ($ricerca["tipo_pratica"] > 2) {
$arr_cond[] = "report._tipo_pratica = " . $ricerca["tipo_pratica"] . "";
}
}
if (is_array($arr_cond)) {
$cond = "(" . implode(") AND (", $arr_cond) . ")";
}
$tabella = new Tabella_h("admin/report", 'view');
$nrows = $tabella->set_dati("{$cond} order by substr(report.numero,4,1),substr(report.numero,5,3),substr(report.numero,1,3)");
}
}
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database");
}
$sql = "(SELECT 0 as id, 'Seleziona ===>' as opzione) UNION (SELECT 1 as id, 'Tutti i Permessi di Costruire' as opzione) UNION (SELECT 2 as id, 'Tutte le D.I.A.' as opzione) UNION (SELECT distinct id,nome as opzione FROM pe.e_tipopratica order by opzione);";
$db->sql_query($sql);
print_debug($sql);
$tipo_pratica = $db->sql_fetchrowset();
$sel_tipo_pratica = "";
foreach ($tipo_pratica as $val) {
$s = $_POST["tipo_pratica"] && $_POST["tipo_pratica"] == $val["id"] ? "selected" : "";
$sel_tipo_pratica .= "<option value=\"" . $val["id"] . "\" {$s}>" . $val["opzione"] . "</option>";
}
?>
<html>
<head>
示例14: sql_db
<?php
include_once "login.php";
$tabpath = "pe";
$notfound = 0;
//Attenzione funzione relazione tra il file elenco e
$pratichexpagina = 5;
$offset = 0;
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
die("Impossibile connettersi al database");
}
if (isset($_POST["pag"])) {
//pagina con i risultati al primo giro faccio tutta la query poi mi porto dietro l'array delle pratiche trovate
$pagenum = $_POST["pag"];
$pratichexpagina = $_POST["xpag"];
$elenco = $_POST["elenco"];
$criterio = $_POST["criterio"];
if (!isset($elenco)) {
//se non ho ancora fatto la query la costruisco
include_once "./db/db.pe.queryricerca.php";
//echo $sqlRicerca;
$db->sql_query($sqlRicerca);
//trovo l'elenco degli id delle pratiche che mi interessano
$elenco_pratiche = $db->sql_fetchlist("pratica");
if ($elenco_pratiche) {
$elenco = implode(",", $elenco_pratiche);
}
$_SESSION["RICERCA"] = $_POST;
} else {
//sono al secondo giro ho l'elenco delle pratiche per la query
示例15: sql_db
}
require_once $currentconfig;
// Do we have template specific settings?
if (isset($_SESSION['template'])) {
$template = $_SESSION['template'];
}
$templateconfig = "templates/" . $template . "/config.php";
if (file_exists($templateconfig)) {
include $templateconfig;
}
if (!isset($main_width)) {
$main_width = 800;
}
global $coddb;
if ($coddb == null) {
$coddb = new sql_db($db_host, $db_user, $db_pass, $db_db, false);
if (!$coddb->db_connect_id) {
die("Could not connect to the database");
}
}
function time2ymd($time, $char = '-')
{
return date(implode($char, array('Y', 'm', 'd')), $time);
}
if (isset($_GET['id'])) {
$plid = $_GET['id'];
$query = "SELECT {$t['b3_clients']}.name, ctime.id, ctime.gone, ctime.came\n FROM {$t['b3_clients']}, ctime, {$t['players']} \n WHERE {$t['players']}.id = \"{$plid}\"\n AND {$t['players']}.client_id = {$t['b3_clients']}.id\n AND {$t['b3_clients']}.guid = ctime.guid\n ORDER BY ctime.id DESC";
} else {
if (isset($_GET['dbid'])) {
$plid = $_GET['dbid'];
$query = "SELECT {$t['b3_clients']}.name, ctime.id, ctime.gone, ctime.came\n FROM {$t['b3_clients']}, ctime\n WHERE {$t['b3_clients']}.id = \"{$plid}\"\n AND {$t['b3_clients']}.guid = ctime.guid\n ORDER BY ctime.id DESC";