看板 PHP 關於我們 聯絡資訊
<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body <form action="radio.php" method="post"> <input type="submit" value="刪除"> </form> </body> </html> <?php @$rr[$n]=$_POST['rr'][$n]; mysql_connect這邊沒問題 mysql_select_db這邊沒問題 mysql_query("SET NAMES utf8"); mysql_query("DELETE customer where customer_ID='$rr[$n]'"); $result= mysql_query("SELECT customer_ID,customer_Name,customer_addres FROM customer "); @$z= "<form action='radio.php' method='post'>"."<table border>\n"; while ($ccc= mysql_fetch_array($result)) { @$z.="<tr>"."<td>"."<input type='radio' name='rr' value='".$ccc['customer_ID']."'>"."</td>". "<td>".@$ccc[customer_ID]."\n"."</td>". "<td>".@$ccc[customer_Name]."\n"."</td>". "<td>".@$ccc[customer_addres]."</br>"."</td>"."</tr>"; } @$z.="</table>"."</form>"; echo $z; 這個是我做的系統管理要刪除客戶資料...... 讓每筆表單前有一個單選鈕可以選 應該是傳遞那邊有問題,刪不了 請問一下哪邊要改 不要罵我QQ 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.27.30.57
kevin820308:補充一下,按下去刪除沒有反應 06/09 09:18
tkdmaf:@ <== 這東西最好不要亂用。該報錯就要讓他報。 06/09 09:50
tkdmaf:通常我會用@ 是因為要讓錯誤訊息用我自己的寫法產生才會用 06/09 09:51
tkdmaf:不要讓可能的錯誤視為理所當然的隱藏在程式碼內。 06/09 09:52
tkdmaf:還有你HTML的寫法結構也不對了。 06/09 09:52
tkdmaf:</html>就已經是網頁結尾,你在後面又繼續寫…… 06/09 09:53
tkdmaf:雖然對瀏覽器而言,他還是會繼續處理,但不是好的結構。 06/09 09:53
Darkland:把刪除的 query echo 出來看看 06/09 10:36
noxhsu:form分開的話,你在哪邊丟值給處理的程式? 06/09 10:56
noxhsu:如果有ajax或javascript處理,那檢查一下送值是否正常 06/09 10:57