This is the php code to delete.
<?php
$namez = $_POST['vendel'];
$name = mysql_real_escape_string($namez);
mysql_connect("localhost","root",
"") or die("Wrong username or password");
mysql_select_db("vendor") or die( "Unable to select database");
mysql_query("DELETE FROM vendoradd WHERE venname='$name'");
?>
And here is the code where I select from a combobox.
<form action="delete.php" method="post">
<select name="vendel">
<?php
$con=mysqli_connect("localhost","root","","vendor") or die("Unable to connect");
$query = mysqli_query($con,"select venname from vendoradd");
while ($row=$query->fetch_assoc()){
echo "<option value=\"vendel1\">".$row['venname']."</option>";
}
?>
</select>
<input type="submit" value="Delete" id="del">
</form>
I am not getting any error, the page is redirecting to delete.php file but when I cross check the database the selected data is not deleted. Any help is appreciated. Thanks in advance