本文整理汇总了PHP中Conexao::prepare方法的典型用法代码示例。如果您正苦于以下问题:PHP Conexao::prepare方法的具体用法?PHP Conexao::prepare怎么用?PHP Conexao::prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conexao
的用法示例。
在下文中一共展示了Conexao::prepare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
function delete($id = null)
{
$sql = "DELETE FROM `user` WHERE id = :id";
$query = Conexao::prepare($sql);
$query->bindValue(":id", $id);
$query->execute();
}
示例2: limpaTexto
$query = "UPDATE " . MYSQL_BASE_WORK_FLOW_FLUXO . " SET download = 'S' WHERE id = ?";
$stmt = $conexao->prepare($query);
$stmt->bindValue(1, $id);
if ($stmt->execute()) {
echo '<script language= "JavaScript">close();</script>';
} else {
echo '<script language= "JavaScript">close();</script>';
}
} else {
$documento = limpaTexto($_GET['documento']);
$conexao = new Conexao();
$stmt = $conexao->query("SELECT a.*, a.versao as revisao FROM " . MYSQL_BASE_ARQUIVOS . " a, " . MYSQL_BASE_DOCUMENTOS . " d\r\n\t\t\tWHERE d.id = a.id_documento AND a.principal = 'S' AND a.id_documento=" . $documento . " LIMIT 1");
foreach ($stmt as $item) {
$idDocumento = $item['id_documento'];
$versaoDocumento = $item['versao'];
$file = $item['file'];
$revisao = $item['revisao'];
}
$conexao->__destruct();
//Insrir registro no log de donwloads
$query = "INSERT INTO " . MYSQL_BASE_LOG_DOWNLOAD . " (id, id_usuario, data, revisao, arquivo, ip)";
$query .= "VALUES (NULL, ?, NOW(), ?, ?, ?)";
$stmt = $conexao->prepare($query);
$stmt->bindValue(1, userId());
$stmt->bindValue(2, $revisao);
$stmt->bindValue(3, $file);
$stmt->bindValue(4, getIP());
if ($stmt->execute()) {
echo '<script language= "JavaScript">close();</script>';
}
}