當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。