16 lines
541 B
PHP
Raw Normal View History

2020-05-01 20:56:26 +02:00
<?php
$connect = new mysqli($servername, $username, $password, $dbname);
if ($connect->connect_errno) {
die("Connexion impossible");
} else {
echo "Connexion OK";
}
$nom = "Bar";
$rechercheNom = "SELECT * from ANNUAIRE WHERE nom like'" . $nom . "%'";
$SearchPrenome = "SELECT * from ANNUAIRE WHERE nom like'" . $prenom . "%'";
$result = $connect->query($rechercheNom);
while ($r = $result->fetch_assoc()) {
echo '<br/>' . $r["nom"] . " " . $r["prenom"] . " " . $r["numPost"] . " " . $r["id"];
}
$connect->close();