[PHP-NOTES] note 130193 added to language.fibers

[email protected] ("Anonymous")
Newsgroups php.notes
Message-ID <[email protected]>
<?php
 
// Datenbankverbindung etablieren
$servername = "mysql";
$username = "root";
$password = "htlkrems";
 
try {
  // Instanz des PDO Objektes erzeugen
  $conn = new PDO("mysql:host=$servername;dbname=classicmodels", $username, $password);
  // PDO Error Mode auf Exception setzen
  $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  //echo "Connected successfully"; // Ausgabe wenn DB-Verbindung ok
} catch(PDOException $e) {
  // Ausgabe der Fehlermeldung falls DB-Verbindung fehlgeschlagen
  echo "Connection failed: " . $e->getMessage();
}
if(isset($_POST['inp'])){
    $inputText = $_POST['inp'];
    $stmt = $conn->query("SELECT * FROM offices WHERE city LIKE '$inputText%'");   // SQL Query ausführen
}
else{
    $stmt = $conn->query("SELECT * FROM offices");   // SQL Query ausführen
}
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);      // alle Daten mit fetchAll fetchen -> Ergebnis ist ein 2-dimensionales Array
 
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 91.113.31.198)
----
Manual Page -- https://php.net/manual/en/language.fibers.php
Edit        -- https://main.php.net/note/edit/130193
Del: integrated  -- https://main.php.net/note/delete/130193/integrated
Del: useless     -- https://main.php.net/note/delete/130193/useless
Del: bad code    -- https://main.php.net/note/delete/130193/bad+code
Del: spam        -- https://main.php.net/note/delete/130193/spam
Del: non-english -- https://main.php.net/note/delete/130193/non-english
Del: in docs     -- https://main.php.net/note/delete/130193/in+docs
Del: other reasons-- https://main.php.net/note/delete/130193
Reject      -- https://main.php.net/note/reject/130193
Search      -- https://main.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.