dapcigar Posted May 7, 2014 Share Posted May 7, 2014 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 Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 7, 2014 Share Posted May 7, 2014 Where is your current code so we can show you what needs to be done? Quote Link to comment Share on other sites More sharing options...
dapcigar Posted May 7, 2014 Author Share Posted May 7, 2014 Here is the issue.. i have this particular code getting data from the DB... <?php include('mysql_connect.php'); $query1 = mysql_query ("select * from requisition where username = '$user' ") or die(mysql_error()); // $result= mysql_query($query1) ;echo " <thead> <tr> <th>ID</th> <th>Category</th> <th>Description</th> <th>Status</th> </tr> </thead> <tbody>";while($row = mysql_fetch_array($query1)){ echo"<tr>"; echo"<td> $row[id]</td>"; echo"<td> $row[category]</td>"; echo"<td> $row[description]</td>"; echo"<td> $row[status]</td>"; echo"</tr>"; } echo"</table>"; echo"</table>"; echo"<div align=center>"; echo"<br>"; echo"</div>"; .................................................... 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> Approve </a> <a class="btn btn-danger" href="#"> <i class="icon-trash icon-white"></i> Deny </td> Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 7, 2014 Share Posted May 7, 2014 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. Quote Link to comment Share on other sites More sharing options...
dapcigar Posted May 8, 2014 Author Share Posted May 8, 2014 Yeah, that is exactly what i want to do. i just got confused and don't know where to go from there.. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 8, 2014 Share Posted May 8, 2014 What do you THINK you have to do? Quote Link to comment Share on other sites More sharing options...
Solution dapcigar Posted May 8, 2014 Author Solution Share Posted May 8, 2014 i solved it.. i created two separate links and use the id to update the data Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.