this code works without an issue...
php script executes from a function.it works without an issue.
<div class="container-md">
<h4>Add New Job</h4>
<?php include '../include/alert-form-submission.php'; ?>
<!-- code here -->
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<form action="add-job-controller.php" method="POST">
<?php include '../include/alert-form-submission.php'; ?>
<div class="form-group">
<label for="jobno">Job No:</label>
<input type="text" name="jobno" class="form-control" placeholder="Enter Job Number" id="jobno" required>
</div>
<div class="form-group">
<label for="client">Client:</label>
<select name="client" class="custom-select">
<option selected>Select Division or District</option>
//php code
</select>
</div>
<div class="form-group">
<label for="letterno">Letter No:</label>
<input type="text" name="letterno" class="form-control" placeholder="Enter Letter Number" id="letterno">
</div>
<button type="submit" name="submit" class="btn btn-primary btn-block">Submit</button>
</div>
but after i placed below php code,page loads up to that point and populates dropdown from mysql database.but rest of the page won't load.so please help me to fix it
<div class="form-group">
<label for="client">Client:</label>
<select name="client" class="custom-select">
<option selected>Select Division or District</option>
<?php
$client = new Job();
$result = $client->getClient();
if ($result->num_rows > 0)
{
while($option = $result->fetch_assoc())
{
echo "<option value=" .$option['id']. ">" .$option['name']. "</option>";
}
}
$conn->close();
?>
</select>
</div>