本文整理汇总了PHP中Conexao::retornaConexaoComBanco方法的典型用法代码示例。如果您正苦于以下问题:PHP Conexao::retornaConexaoComBanco方法的具体用法?PHP Conexao::retornaConexaoComBanco怎么用?PHP Conexao::retornaConexaoComBanco使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conexao
的用法示例。
在下文中一共展示了Conexao::retornaConexaoComBanco方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SoftwareDAO
<title>Escritor De Software</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<div id="topo">
<img src="images/logo.png" alt="" />
</div>
<div id="conteiner">
<?php
if ($_GET['idsoftware']) {
// vou fechar isso lá no final
$_SESSION['meuSoftwareId'] = $_GET['idsoftware'];
$conexao = Conexao::retornaConexaoComBanco();
$softwaredao = new SoftwareDAO();
$softwaredao->setConexao($conexao);
$software = new Software();
$software->setId($_GET['idsoftware']);
$software = $softwaredao->retornaSoftwareDetalhado($software);
?>
<div id="esquerda">
<?php
echo '<h1>' . $software->getNome() . '</h1>';
echo '<h2>Informações:</h2>
<p>Linguagem: ' . $software->getLinguagem();
if ($software->getBancoDeDados()) {
示例2: Atributo
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Escritor De Software</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<?php
if ($_GET['id_atributo']) {
//iremos deletar um atributo aqui.
$atributo = new Atributo();
$atributo->setId($_GET['id_atributo']);
$atributodao = new AtributoDAO();
$atributodao->setConexao(Conexao::retornaConexaoComBanco());
if ($atributodao->deletarAtributo($atributo)) {
echo 'Atributo deletado com sucesso<META HTTP-EQUIV="REFRESH" CONTENT="5; URL=software.php">
<a href="javascript:window.history.go(-1)">Voltar</a>';
} else {
echo 'Falha.
<a href="javascript:window.history.go(-1)">Voltar</a>';
}
}
?>
</body>
</html>