当前位置: 首页>>代码示例>>PHP>>正文


PHP PDO::close方法代码示例

本文整理汇总了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>
开发者ID:JesusCaballeroCorpas,项目名称:ejercicios-php,代码行数:30,代码来源:ejer04Eliminar.php

示例2: closeConnection

 function closeConnection()
 {
     if (self::$conn !== null) {
         self::$conn->close();
     }
 }
开发者ID:oneacik,项目名称:foodfront-website,代码行数:6,代码来源:Connections.php

示例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 &quot;" . $_REQUEST['name'] . "&quot; and id &quot;" . $daemonid . "&quot; 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);
开发者ID:heinervdm,项目名称:ESP8266-Temperatursensor,代码行数:31,代码来源:index.php

示例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();
}
?>


开发者ID:aniketshah6,项目名称:conley-morse-database,代码行数:28,代码来源:checkradio-form.php


注:本文中的PDO::close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。