<form action="saveoffence.php" method="POST">
<select class ='text' name='offencetype'>
<?php
$server = 'localhost';
$username = 'root';
$password = '';
$database = 'database';
try{
$conn = new PDO("mysql:host=$server;dbname=$database;", $username, $password);
} catch(PDOException $e){
die( "Connection failed: " . $e->getMessage());
}
$cdquery="SELECT offencetype from offence";
$cdresult=mysql_query($cdquery) or die ("Query to get data from firsttable failed: ".mysql_error());
while ($cdrow=mysql_fetch_array($cdresult)) {
$cdTitle=$cdrow["offencetype"];
echo "<option> $cdTitle </option>";
}
?>
</select>
<input type="text" placeholder="Enter Csae Content" required name="offence">
<input type="submit">
<div id = "footer">
</div>
</form>
Thanks