suppression tableau dynamque html
Bonjour je bloque sur un problème assez mais je n'arrive pas à le résoudre :(
Je génère en PHP un tableau html via une requête SQL jusqu'ici tout va bien.
En chaque fin de les deux dernières colonnes sont des boutons supprimer et modifier.
Le problème est que je ne vois pas comment supprimer la ligne et les champs dans la bd via le bouton supprimer.
Voici le code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <form name="modification" action="products_attributes.php" method="POST">
<table>
<tr class="dataTableHeadingRow">
<td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; font-weight: bold"> <?php echo TABLE_HEADING_PRODUCT; ?></td><td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; font-weight: bold"><?php echo TABLE_HEADING_OPT_NAME;?></font></td><td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; font-weight: bold"> <?php echo TABLE_HEADING_OPT_VALUE; ?></font></td><td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 12px; color: #ffffff; font-weight: bold"> Modifier</font></td><td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; font-weight: bold"> Supprimer</font></td>
</tr>
<?php
$color=false;
while($modif=tep_db_fetch_array($req_modif))
{
if($color==true)
{
echo '<tr class="dataTableHeadingRow">';
echo '<td height="6"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; font-weight: bold">'.$modif['products_name'].'</font></td>';
echo '<td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; font-weight: bold">'.$modif['products_options_name'].'</font></td>';
echo '<td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; font-weight: bold">'.$modif['products_options_values_name'].'</font></td>';
echo '<td height="6" bgcolor="#ffffff" align="center"><input type="button" name="Supprimer" value="Supprimer"/></td>';
echo '<td height="6" bgcolor="#ffffff" align="center"><input type="button" name="Modifier" value="Modifier"/></td>';
echo '</tr>';
$color=false;
}
else
{
echo '<tr>';
echo '<td height="6"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; font-weight: bold">'.$modif['products_name'].'</font></td>';
echo '<td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; font-weight: bold">'.$modif['products_options_name'].'</font></td>';
echo '<td height="6" align="center"><font style= "font-family: Verdana, Arial, sans-serif; font-size: 11px; font-weight: bold">'.$modif['products_options_values_name'].'</font></td>';
echo '<td height="6" bgcolor="#ffffff" align="center"><input type="button" name="Supprimer" value="Supprimer"/></td>';
echo '<td height="6" bgcolor="#ffffff" align="center"><input type="button" name="Modifier" value="Modifier"/></td>';
echo '</tr>';
$color=true;
}
}
?> |
voici la requête :
Code:
$req_modif=tep_db_query("SELECT products_name,products_options_values_name,products_options_name FROM ".TABLE_PRODUCTS_ATTRIBUTES." pa join ".TABLE_PRODUCTS_DESCRIPTION." pd join ".TABLE_PRODUCTS_OPTIONS." po join ".TABLE_PRODUCTS_OPTIONS_VALUES." pov where pa.products_id=pd.products_id and pa.options_id=po.products_options_id and pa.options_values_id=pov.products_options_values_id ORDER BY products_attributes_id DESC LIMIT ".$premiereEntree." , ".$messagespage);
Ps il y a bcp de CSS dsl je n'arrive pas à faire passer toutes les classes