• All Pharmacies
  • " . $row[name] . "
  • Add Pharmacy Item
  • Search Results
  • Pharmacy Search System




    Download 377,37 Kb.
    bet5/5
    Sana23.12.2023
    Hajmi377,37 Kb.
    #127470
    1   2   3   4   5
    Bog'liq
    Asadbek Yangibayev-DESKTOP-HEIKKOO

    Pharmacy Search System









    Add Pharmacy




    All Pharmacies:


    include 'db.php';

    $sql = "SELECT * FROM pharmacies";


    $result = $conn->query($sql);

    if ($result->num_rows > 0) {


    while ($row = $result->fetch_assoc()) {
    echo "
    ";
    echo "
    ";
    echo "
    " . $row['name'] . "
    ";
    echo "
    ID: " . $row['id'] . "
    Address: " . $row['address'] . "
    Phone: " . $row['phone'] . "
    ";
    echo "
    ";
    echo "
    ";
    }
    } else {
    echo "
    No pharmacies found.
    ";
    }

    $conn->close();


    ?>







    Add Pharmacy Item


























    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $search = $_POST['search'];

    $sql = "SELECT * FROM pharmacies WHERE name LIKE '%$search%'";


    $result = $conn->query($sql);

    if ($result->num_rows > 0) {


    echo "

    Search Results:

    ";
    while ($row = $result->fetch_assoc()) {
    echo "
    ";
    echo "
    ";
    echo "
    " . $row['name'] . "
    ";
    echo "
    ID: " . $row['id'] . "
    Address: " . $row['address'] . "
    Phone: " . $row['phone'] . "
    ";
    echo "
    ";
    echo "
    ";
    }
    } else {
    echo "
    No results found.
    ";
    }
    }
    ?>






    Download 377,37 Kb.
    1   2   3   4   5




    Download 377,37 Kb.