本文整理汇总了PHP中PDO::close方法的典型用法代码示例。如果您正苦于以下问题:PHP PDO::close方法的具体用法?PHP PDO::close怎么用?PHP PDO::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDO
的用法示例。
在下文中一共展示了PDO::close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<h5>¿Esta seguro que desea borrar este artículo?</h5>
<form action="ejer04Gestesimal.php" method="post">
<input type="hidden" name="codArt" value="<?php
echo $codArt;
?>
">
<button class="btn waves-effect waves-light green" type="submit" name="action" value="borrar">SI
<i class="material-icons right">delete</i>
</button>
<a href="ejer04Gestesimal.php" class="btn waves-effect waves-light red">NO
<i class="material-icons right">cancel</i>
</a>
</form>
<br>
<a href="ejer04Gestesimal.php" class="btn waves-effect waves-light blue">Volver
<i class="material-icons left">arrow_back</i>
</a>
</div>
</article>
</section>
</body>
<footer>
<p class="center-align"> © Jesús Caballero Corpas ©</p>
</footer>
<?php
$conexion->close();
?>
</html>
示例2: closeConnection
function closeConnection()
{
if (self::$conn !== null) {
self::$conn->close();
}
}
示例3: daemon
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$daemonid = 0;
if (isset($row['daemonid'])) {
$daemonid = $row['daemonid'];
} else {
$stmt = $db->prepare('INSERT INTO daemon (uid, name, shortname) VALUES (:uid, :uid, :uid);');
$stmt->bindValue(':uid', $_REQUEST["uid"][$i], PDO::PARAM_STR);
$stmt->execute();
$daemonid = $db->lastInsertId();
}
$stmt = $db->prepare("INSERT INTO value (daemonid, value, unixtime) VALUES (:daemonid, :value, strftime('%s', 'now', 'localtime'));");
$stmt->bindValue(':daemonid', $daemonid, PDO::PARAM_INT);
$stmt->bindValue(':value', (double) $_REQUEST["value"][$i], PDO::PARAM_STR);
$stmt->execute();
}
$db->close();
exit;
} else {
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "adddaemon" && isset($_REQUEST['uid']) && isset($_REQUEST['name']) && isset($_REQUEST['shortname']) && isset($_REQUEST['unit'])) {
$stmt = $db->prepare('INSERT INTO daemon (uid, name, shortname, unit) VALUES (:uid, :name, :shortname, :unit);');
$stmt->bindValue(':name', $_REQUEST["name"], PDO::PARAM_STR);
$stmt->bindValue(':shortname', $_REQUEST["shortname"], PDO::PARAM_STR);
$stmt->bindValue(':unit', $_REQUEST["unit"], PDO::PARAM_STR);
$stmt->bindValue(':uid', $_REQUEST["uid"], PDO::PARAM_STR);
$stmt->execute();
$daemonid = $db->lastInsertId();
$msg = ' <div class="message">Sensor ' . $_REQUEST['shortname'] . " with name "" . $_REQUEST['name'] . "" and id "" . $daemonid . "" created.</div>\n";
} else {
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "edit" && isset($_REQUEST['uid']) && isset($_REQUEST['name']) && isset($_REQUEST['shortname']) && isset($_REQUEST['unit']) && isset($_REQUEST['daemonid'])) {
$stmt = $db->prepare('UPDATE daemon SET uid=:uid, name=:name, shortname=:shortname, unit=:unit WHERE daemonid=:daemonid;');
$stmt->bindValue(':daemonid', $_REQUEST["daemonid"], PDO::PARAM_INT);
示例4: die
// if no basic query, we select everything
$sqlquery = "select distinct MORSEGRAPHFILEID from morsesets";
}
//echo "$sqlquery";
$results = $file_db->query($sqlquery) or die('Query failed');
// Construct the Table
echo "<table border=\"1\">";
$counter = 0;
foreach ($results as $m) {
if ($counter == 0) {
echo "<tr>";
}
$MGfileindex = $m[MORSEGRAPHFILEID];
echo "<td> <img src=\"graphs/MGCC{$MGfileindex}.png\" usemap=\"#MGCC{$MGfileindex}\" width=\"200\" > </td>";
$counter = $counter + 1;
if ($counter == 5) {
echo "</tr>";
$counter = 0;
}
// Introduce the "map" objects
include "graphs/MGCC{$MGfileindex}-cmapx.html";
}
echo "</table>";
$file_db->close();
} catch (PDOException $e) {
echo $e->getMessage();
}
?>