Jump to content

Multiple action on table rows


Recommended Posts

i want to add two different actions to each row. for example, i want to be able to approve or deny the report on each row.




 i want the approve and deny  icon to update every row in the database.. 


Yea, am a newbie.. if you could please give me a syntax that could make this work, i woud appreciate it..



 Thanks in advance


Link to comment
Share on other sites

Here is the issue.. i have this particular code getting data from the DB...


  $query1 =  mysql_query ("select * from requisition where username = '$user' ") or die(mysql_error());
 // $result= mysql_query($query1) ;
echo "
while($row = mysql_fetch_array($query1))
    echo"<td> $row[id]</td>";
    echo"<td> $row[category]</td>";                
    echo"<td> $row[description]</td>";
    echo"<td> $row[status]</td>";
              echo"<div align=center>";







Now i want to include something like this to control the data in each row


<td class="center"><span class="label label-success">Approved</span></td>
                      <td class="center">
                      <a class="btn btn-info" href="#">
                                        <i class="icon-edit icon-white"></i>  
                                    <a class="btn btn-danger" href="#">
                                        <i class="icon-trash icon-white"></i>

Link to comment
Share on other sites

To control the data in each row.  Interesting choice of words.


I'm guessing you want to display the data from your db for a specific user.  Then you wish to allow the user to approve or deny a row at will.  Do you envision this process being done at the server and then having the screen refreshed with the data changed according to the process that occurred?  Very confusing to look at an anchor with no href - what is it supposed to do?


I have done this in the past by making the data of each row a separate form with a hidden field (?) containing the key of the row and then having two buttons that submit the form with a script that responds to handle the button clicked.  Then the screen is refreshed.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.