[Solved] PHP/SQL Delete button for each row [closed]


You should use mysqli or pdo
You have missed 3 points:

fix your query:
1) make sure you have selected all required fields.

$filme_cart = mysql_query("SELECT * FROM cart_test GROUP BY name");

2) Try using: mysql_fetch_assoc

  <?php
    while($film_cart=mysql_fetch_assoc($filme_cart))
      {
      echo "<tr>";  
      echo "<td align='left'>";
      echo $film_cart['name'];
      echo "</td>";
      echo "<td class="cart-product-setting">";
      echo $film_cart['price'];
      echo "<a href="https://stackoverflow.com/questions/21048004/delete.php?delete_film=".$film_cart["id_film']."' class="remove-pro" rel="tooltip" data-title="Delete"><i class="icon-trash"></i></a></td>";  
      echo "</tr>";
    } 
    ?>

And then : 3) get value by $_GET['delete_film']

<?php

include 'config.php';

$delete_film=$_GET['delete_film'];

$delete_cart = mysql_query("DELETE FROM cart_test WHERE id_film=$delete_film limit 1");

?>

2

solved PHP/SQL Delete button for each row [closed]