为什么按一个按钮的PHP形式表显示消失?

时间:2015-10-16 20:17:43

标签: php

我有一个带有列表框的表单,该表单报告了MySql数据库中记录的一些id客户端。我选择了一个这个id客户端我点击一个名为selected-record的按钮,我从数据库中获取数据,这些数据显示在php表中。这可以。然后我点击第二个名为delete-record的按钮,目标是获取客户端的id - 变量$num_client - 并运行sql delete指令删除记录。到目前为止我无法解决2分问题。

  1. 为什么要按" delete_record"按钮显示的表格pressind selected_record会立即在表单上取消吗?
  2. 为什么当我按delete_record指令echo num_client;`给出一个空值?
  3. if ( isset($_POST['selected_record'])){
            // visualiazzazione tabella

    echo "<table border='1'> <tr> <th>Id cliente</th> <th>Ragione Sociale</th> <th>address</th> <th>village</th> <th>Provincia</th> <th>Contatto</th> <th>Dipartimento</th> </tr>"; echo "<tr>"; echo "<td>" . $num_client. "</td>"; echo "<td>" . $rag_soc. "</td>"; echo "<td>" . $address. "</td>"; echo "<td>" . $village. "</td>"; echo "<td>" . $provincia. "</td>"; echo "<td>" . $contact_client. "</td>"; echo "<td>" . $dipart. "</td>"; echo "</tr>"; echo "</table>"; $result=mysqli_query($con,"SELECT id_cliente , ragione_sociale FROM clienti"); } if( isset($_POST['delete_record'])) { // Here If I make echo $num_client this gives no value ?? //$sql_del = "DELETE FROM `db_ordini_clienti`.`clienti` WHERE `id_cliente` = $num_client"; }

0 个答案:

没有答案