note 130092 added to install.composer.intro

From: Date: Fri, 28 Feb 2025 11:29:20 +0000
Subject: note 130092 added to install.composer.intro
Groups: php.notes 
Request: Send a blank email to php-notes+get-221918@lists.php.net to get a copy of this message
<?php $servername = "mysql"; $username = "root"; $password = "htlkrems"; $dbname = "classicmodels"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); } $conn->query("SET FOREIGN_KEY_CHECKS=0"); if(isset($_GET['delnum'])){ $delnum = $_GET['delnum']; $abfrage2 = $conn -> query("DELETE FROM employees WHERE employees.employeeNumber = $delnum; "); } if(isset($_GET['order'])){ $order = $_GET['order']; $abfrage1 = $conn -> query("SELECT * FROM employees ORDER BY $order; "); }elseif(isset($_GET['Search'])){ $search = $_GET['Search']; $abfrage1 = $conn -> query("SELECT * FROM employees WHERE employees.firstName LIKE '%$search%'; " ); }else{ $abfrage1 = $conn -> query("SELECT * FROM employees; " ); } $result1 = $abfrage1 -> fetchAll(PDO::FETCH_ASSOC); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> </head> <body> <form methode=GET> <input type="text" name="Search" > <input type="submit" value="Submit" > </form> <?php echo "<table class='table table table-striped'>"; echo " <tr> <th> <a href='?order=employeeNumber' >employeeNumber</a></th> <th>lastName</th> <th><a href='?order=firstName'>firstName</a></th> <th>extension</th> <th>email</th> <th><a href='?order=officeCode'>officeCode</a></th> <th>reportsTo</th> <th>jobTitle Price</th> <th>Delete</th> <th>Details</th> </tr>"; for ($i=0; $i < count($result1); $i++) { echo "<tr>"; echo"<td>".$result1[$i]['employeeNumber']."</td>"; echo"<td>".$result1[$i]['lastName']."</td>"; echo"<td>".$result1[$i]['firstName']."</td>"; echo"<td>".$result1[$i]['extension']."</td>"; echo"<td>".$result1[$i]['email']."</td>"; echo"<td>".$result1[$i]['officeCode']."</td>"; echo"<td>".$result1[$i]['reportsTo']."</td>"; echo"<td>".$result1[$i]['jobTitle']."</td>"; $officeid = $result1[$i]['officeCode']; $delnum = $result1[$i]['employeeNumber']; echo "<td><a href=?delnum=$delnum>Delete</a></td>"; echo "<td><a href=details.php?officeid=$officeid>Details</a></td>"; echo "</tr>"; } echo "</table>"; ?> </body> </html> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 193.170.70.27) ---- Manual Page -- https://php.net/manual/en/install.composer.intro.php Edit -- https://main.php.net/note/edit/130092 Del: integrated -- https://main.php.net/note/delete/130092/integrated Del: useless -- https://main.php.net/note/delete/130092/useless Del: bad code -- https://main.php.net/note/delete/130092/bad+code Del: spam -- https://main.php.net/note/delete/130092/spam Del: non-english -- https://main.php.net/note/delete/130092/non-english Del: in docs -- https://main.php.net/note/delete/130092/in+docs Del: other reasons-- https://main.php.net/note/delete/130092 Reject -- https://main.php.net/note/reject/130092 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221918) next »