pavanpuligandla Posted September 24, 2008 Share Posted September 24, 2008 hii,, I've 2 combo boxes in my front end html form, user has to select values from both the combo boxes to delete records frm mysql table, my delete query is not being executed,, please help me out.. herez my front end form, <TD CLASS="text"> <SPAN STYLE="font-weight: bold; color:#001F97;"> Batch ID: </SPAN> </TD> <td> <select name="Batch" style="width:180px; font-weight:bold; color:#001F97;"><option value="" selected="selected"><b>-Select Batch ID-</option></b> <option value="T08" style="font-weight:bold">T08</option> <option value="T09" style="font-weight:bold">T09</option> <option value="T10" style="font-weight:bold">T10</option> <option value="T11" style="font-weight:bold">T11</option> <option value="T12" style="font-weight:bold">T12</option> <option value="T13" style="font-weight:bold">T13</option> <option value="T14" style="font-weight:bold">T14</option> <option value="T15" style="font-weight:bold">T15</option> </select> </td> </tr> <tr> <TD CLASS="text"> <SPAN STYLE="font-weight: bold; color:#001F97;"> Exam Type: </SPAN> </TD> <td> <select name="Type" style="width:180px; font-weight:bold; color:#001F97;"><option value="" selected="selected">-Select Type-</option> <option value="In I" style="font-weight:bold">In I</option> <option value="In II" style="font-weight:bold">In II</option> <option value="In III" style="font-weight:bold">In III</option> <option value="In IV" style="font-weight:bold">In IV</option> <option value="Inl V" style="font-weight:bold">Inl V</option> <option value="In VI" style="font-weight:bold">In VI</option> <option value="Final " style="font-weight:bold">Final </option> <option value="Ext" style="font-weight:bold">Ext</option> </select> </tr> </td> </table> mysql php delete query : <?PHP include "authn.php"; //Connect to mysql server $link=mysql_connect("localhost","root",""); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db=mysql_select_db("tge"); if(!$db) { die("Unable to select database"); } $Batch = $_POST['Batch']; $Type = $_POST['Type']; $query = mysql_query("DELETE FROM in WHERE Type = '$Type' AND Batch = '$Batch'") or die(mysql_error()); echo "records deleted"; ?> i want to delete rows based on this type and batch only.. as there are several batches and types are there in th table.. many thanks. Link to comment https://forums.phpfreaks.com/topic/125638-php-mysql-query-to-delete-records-from-table-using-combo-box-selection/ Share on other sites More sharing options...
Barand Posted September 24, 2008 Share Posted September 24, 2008 Are you getting an error message? Link to comment https://forums.phpfreaks.com/topic/125638-php-mysql-query-to-delete-records-from-table-using-combo-box-selection/#findComment-649841 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.