0

Hi guys,

I have php code that generates a table based on the results of a mysql query. My questions is how do I update edit the html table row and push the changes to a mysql table? I am using this example: http://bootsnipp.com/snipps/table-with-users The thing I am trying to avoid is to call another page. I would like to give the user the ability to edit the data on the same page rather than drilling down into another one. Here is a snippit of my table build:

while($row = array($getResults))
{
    $stat;
    if($row['status'] == 0)
    $stat = "<span class='label label-success'>User</span>";
    else if($row['status']  == 1)
    $stat = "<span class='label label-warning'>Club Admin</span>";
    else if($row['status']  == 3)
    $stat = "<span class='label label-important'>Banned</span>";
    else
    $stat = "<span class='label label-info'>System Admin</span>";

    echo "<tr>
    <td>" . $row['username'] . "</td>".
    "<td style='text-align:center'>" . $row['fullName'] . "</td>".
    "<td style='text-align:center'>" . $stat . "</td>".
    "<td style='text-align:left'><a href='#'><i class='icon-pencil'></i></a></td>
    </tr>";
}

On the last column of '<td style='text-align:left'><a href='#'><i class='icon-pencil'></i></a></td>' I would like to generate a modal or just make the row fields editable and then update the changes on the back end. Thanks for your help!

3
Contributors
3
Replies
29
Views
4 Years
Discussion Span
Last Post by while(!success)
1

The idea is to use jQuery/javascript to create a form with the row you want to edit and push the changes to a server side script via AJAX when the form is submitted.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.