Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<table class='table'>".
- "<thead>".
- "<tr>".
- "<td>ID</td>".
- "<td>url_video</td>".
- "</tr>".
- "</thead><tbody>";
- while($valor = mysqli_fetch_array($resultado)){
- echo "<tr>".
- "<td>".$valor['ID']."</td>".
- "<td><input type='text' value='".$valor['url_video']."' style='width: 400px;' id='url-video'></td>".
- "<td><input type='button' value='Update' class='btn-update' data-id='".$valor['ID']."' >"."</td>".
- "</tr>";
- }
- echo "</tbody></table>";
- $(document).ready(function(){
- $('.btn-update').click(function(){
- var id = $('.btn-update').data('id');
- var string = $('.url_video').val();
- $.ajax({
- url: "tabelaUpdate.php",
- data: { 'idDeUpdate' : id,
- 'url_video' : string
- },
- type: "POST",
- cache: false,
- success: function(response){
- //alert("ok"+response);
- $('#result').html(response); //serve para ver a array foi inserida mesmo
- }
- })
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement