How to add the option tag inside php table and pass the selected value to mysql db without submit button?

I have created an escalation system where user uploads .csv file and user can view the uploaded details in web page.

An option tag will be displayed in each row with the below options:

  • First level Escalation sent
  • Second level Escalation sent
  • Third level Escalation sent.

I simply want to store the selected item to save in the DB, so the other agent who use the system can see which level escalation has been sent for each complaints.

Here is my code. I am unable to store the option item in DB. Ex: When I select "*First level Escalation sent" it doesn't display to others. Pls help

<table width="100%" border="1" cellpadding="1" cellspacing="1" style="font-size:10.5px; font-family:verdana;" >
    <td>SR Number</td>
    <td>Service Impact</td>
    <td>Customer Ref No</td>
    <td>Reported Date and Time</td>
    <td>Pending Reason as per TAC</td>
    <td>Expected Time for Resolution</td>
    <td>TAC Agent</td>
    <td>Cx Contact</td>
    <td>Elapsed Time</td>
    <td>Send Email</td>

while ($ccs=mysqli_fetch_assoc($records)) {
	<tr class='options'>
    $the_time = date('H:i');
    $hours = "00";
    $minutes = "00";
    $seconds = "00";
    $datetime1 = new DateTime($the_time);	
    $datetime2 = new DateTime($new_time);
    $interval = $datetime2->diff($datetime1);			
    $minutes= $interval->format('%i');
    $seconds= $interval->format('%s');

    echo $hours." Hours  ".$minutes."  Minutes ".$seconds." Seconds</br></br>";
    <td><a href=Escalation_Display.php?delete=$B>Archive</a></td>
    <td><a href=Escalation_Display.php?ID=$B>Email</a> </td>  
        <select id='select'>
            <option value='1'>select</option>
            <option value='2'>First level Escalation sent</option>
            <option value='3'>SECOND</option>
            <option>CLOSURE NOT SENT</option>


Make one column name Comment in table from where you are fetching record ($records). I tried. I gave you how to do. But, please make changes in if condition in <select></select> if required.

    while ($ccs=mysqli_fetch_assoc($records)){
        $B=$ccs['SRNUMBER']; I assumed column 'id' (Primary Key and auto-incremented). Change with your column name.
        $escValue=$ccs['Comment']; I assumed column 'escalation_value' as i wrote above.
            <select id='selectEscalation'>
                <option hidden>Select</option>
                if($escValue != 1) {
                <option value="1."-".$B;">First level Escalation sent</option>
                if($escValue != 2 && $escValue == 1) {
                <option value="2 . "-" . $B;">Second level Escalation sent</option>
                if($escValue != 3 && $escValue==2) {
                <option value="3."-".$B;">Third level Escalation sent</option>
                if($escValue == 3) {
                <option>CLOSURE NOT SENT</option>

        var EscalationValue=$('#selectEscalation').val();
            alert("Escalation Sent");


// split the contents of $_POST['data'] on a hyphen, returning at most two items
list($data_value, $data_id) = explode("-", $_POST['EscalationValue'], 2);

//escalation_value column name as i wrote above.
$Query="UPDATE TableName SET Comment='$data_value' WHERE SRNUMBER='$data_id'"


Need Your Help

Azure Web App Performance Test

azure azure-web-sites

Noticed a Performance Test feature on Azure Web Apps.

copy vs deepcopy: semantics

python python-3.x copy deep-copy

My class represents states of various systems. Each instance has two attributes: one is a container shared between all the states of the same system, and the other is a container that is unique to ...