當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BD::Exec方法代碼示例

本文整理匯總了PHP中BD::Exec方法的典型用法代碼示例。如果您正苦於以下問題:PHP BD::Exec方法的具體用法?PHP BD::Exec怎麽用?PHP BD::Exec使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BD的用法示例。


在下文中一共展示了BD::Exec方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: LogUsuario

 function LogUsuario($pUserid, $pOrigem, $pLogado)
 {
     $gi = geoip_open($_SERVER['DOCUMENT_ROOT'] . "/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
     $geoip = geoip_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);
     $db = new BD();
     $sql = sprintf("select count(*) qtde from log_usuario\n            where\n            ip = '%s'\n            and sessionid = '%s'", $_SERVER['REMOTE_ADDR'], session_id());
     $db->Query($sql);
     $db->Next();
     if ($db->getValue("qtde") == 0) {
         $sql = sprintf("insert into log_usuario\n\t\t\t\t\t(userid,datahora,origem,logado,ip,sessionid,cidade,estado,pais)\n\t\t\t\t\tvalues (%d,now(),'%s','%s','%s','%s','%s','%s','%s')", $pUserid, $pOrigem, $pLogado, $_SERVER['REMOTE_ADDR'], session_id(), $geoip->city, RetornaEstado($geoip->country_code, $geoip->region), $geoip->country_name);
     } else {
         $sql = sprintf("update log_usuario\n\t\t\t\t\t\t\tset userid = %d,\n\t\t\t\t\t\t\t\torigem = '%s',\n\t\t\t\t\t\t\t\tlogado = '%s',\n\t\t\t\t\t\t\t\tqtde = qtde + 1\n\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\tip = '%s'\n\t\t\t\t\t\t\t\tand sessionid = '%s'", $pUserid, $pOrigem, $pLogado, $_SERVER['REMOTE_ADDR'], session_id());
     }
     $db->Exec($sql);
     $db->Close();
     geoip_close($gi);
 }
開發者ID:alencarmo,項目名稱:OCF,代碼行數:17,代碼來源:class.usuario.php

示例2: RegistraVoto

 function RegistraVoto($opc)
 {
     //Registra o voto na opção informada
     $db = new BD();
     $sql = sprintf("insert into cad_enquete_votos\n\t                    (numero,opcao,ip,datahora,userid)\n\t\t\t\t\t\tvalues (%d,%d,'%s',date_add(now(),interval 1 hour),%d)", $this->getCodigo(), $opc, $_SERVER['REMOTE_ADDR'], $_SESSION['userid']);
     $db->Exec($sql);
     $db->Close();
 }
開發者ID:alencarmo,項目名稱:OCF,代碼行數:8,代碼來源:class.enquete.php

示例3: trim

<?php

include "sessao.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/class.bd.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/class.usuario.php";
$userid = $_GET['usr'];
$id = trim($_GET['id']);
$usr = new Usuario($userid);
$cnf = md5(trim(trim($usr->getUsername()) . "lstmailexc" . trim($usr->getEMail())));
if ($id == $cnf) {
    $db = new BD();
    $sql = sprintf("update cad_usuario\n\t\t\t\t\t\t\t\tset recmail = 'N'\n\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\tuserid = %d", $userid);
    $db->Exec($sql);
    $db->Close();
}
echo "<script> window.location = 'index.php'; </script>";
開發者ID:alencarmo,項目名稱:OCF,代碼行數:16,代碼來源:prc_excmail.php

示例4: Exclui

 function Exclui()
 {
     //Exclui a reuniao
     if ($this->Existe == 'N') {
         return;
     }
     $db = new BD();
     $sql = sprintf("delete from smsserver_out where id = %d", $this->getID());
     $db->Exec($sql);
     $db->Close();
 }
開發者ID:alencarmo,項目名稱:OCF,代碼行數:11,代碼來源:class.smssend.php

示例5: Exclui

 function Exclui()
 {
     //Exclui o evento
     if ($this->Existe == 'N') {
         return;
     }
     $db = new BD();
     $sql = sprintf("delete from cad_eventos where id = %d", $this->getID());
     $db->Exec($sql);
     $db->Close();
     $pasta = sprintf("./eventos/%06d/", $this->getID());
     if (is_dir($pasta) == true) {
         rmdir($pasta) or die("erro excluindo diretorio");
     }
 }
開發者ID:alencarmo,項目名稱:OCF,代碼行數:15,代碼來源:class.evento.php

示例6: RetornaEstado

<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/sessao.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/class.bd.php";
include $_SERVER['DOCUMENT_ROOT'] . "/geoipcity.inc";
$gi = geoip_open($_SERVER['DOCUMENT_ROOT'] . "/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
$db = new BD();
$db2 = new BD();
$sql = sprintf("select sequencia,ip,datahora,cidade from log_usuario where cidade is null\nand datahora >= '2008-01-01 00:00' and ip is not null order by sequencia");
$db->Query($sql);
//        $db->Next();
while ($db->Next()) {
    echo $db->getValue("sequencia") . " " . $db->getValue("ip") . " " . $db->getValue("cidade");
    $geoip = geoip_record_by_addr($gi, $db->getValue("ip"));
    $sql = sprintf("update log_usuario\n\t\t\t  \t\t\t\tset cidade='%s',\n\t\t\t\t\t\t\t\testado='%s',\n\t\t\t\t\t\t\t\tpais='%s'\n\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\tsequencia=%d", $geoip->city, RetornaEstado($geoip->country_code, $geoip->region), $geoip->country_name, $db->getValue("sequencia"));
    $db2->Exec($sql);
}
$db->Close();
$db2->Close();
geoip_close($gi);
function RetornaEstado($pais, $regiao)
{
    require_once $_SERVER['DOCUMENT_ROOT'] . "/geoipregionvars.php";
    return $GEOIP_REGION_NAME[$pais][$regiao];
}
開發者ID:alencarmo,項目名稱:OCF,代碼行數:25,代碼來源:acertageoip.php


注:本文中的BD::Exec方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。