本文整理汇总了PHP中BD::getInsertID方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::getInsertID方法的具体用法?PHP BD::getInsertID怎么用?PHP BD::getInsertID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::getInsertID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Inclui
function Inclui()
{
//Insere nova enquete
$x = 0;
$db = new BD();
$sql = sprintf("insert into cad_enquete\n\t\t \t\t\t\t (pergunta,datainicio,datafim,tiporesposta,restrita)\n\t\t\t\t\t\t values ('%s',curdate(),'%s','%s','%s')", $this->getPergunta(), date("Y/m/d", $this->getDataFim()), $this->getTipoResposta(), $this->getRestrita());
$db->Exec($sql);
$this->Codigo = $db->getInsertID();
$db->Close();
$this->IncluiOpcoes();
}
示例2: Inclui
function Inclui()
{
//Insere novo evento
$x = 0;
$db = new BD();
$sql = sprintf("insert into cad_eventos\n\t\t \t\t\t\t (data,local,descricao)\n\t\t\t\t\t\t values ('%s','%s','%s')", date("Y/m/d", $this->getData()), $this->getLocal(), $this->getDescricao());
$db->Exec($sql);
$this->ID = $db->getInsertID();
$pasta = "./eventos";
if (is_dir($pasta) == false) {
mkdir($pasta) or die("erro criando diretorio");
chmod($pasta, 0777);
}
$pasta = sprintf("./eventos/%06d/", $this->ID);
if (is_dir($pasta) == false) {
mkdir($pasta) or die("erro criando diretorio");
chmod($pasta, 0777);
}
$db->Close();
}
示例3: Inclui
function Inclui()
{
//Insere nova reunião
$x = 0;
$db = new BD();
$sql = sprintf("insert into cad_reuniao\n\t\t \t\t\t\t (data,hora,local)\n\t\t\t\t\t\t values ('%s','%s','%s')", date("Y/m/d", $this->getData()), date("H:i", $this->getHora()), $this->getLocal());
$db->Exec($sql);
$this->ID = $db->getInsertID();
$db->Close();
}
示例4: Inclui
function Inclui()
{
//Insere novo evento
$x = 0;
$db = new BD();
$sql = sprintf("insert into tb_calendario\n\t\t \t\t\t\t (dataevento,titulo,descricao,local,realizacao)\n\t\t\t\t\t\t values ('%s','%s','%s','%s','%s')", date("Y/m/d", $this->getData()), $this->getTitulo(), $this->getDescricao(), $this->getLocal(), $this->getRealizacao());
$db->Exec($sql);
$this->ID = $db->getInsertID();
$db->Close();
}