1

入力の変数値に問題があります。

ということで、わかりやすいように。私はmysqlデータベースにいくつかのクライアント情報を持っています.phpをテーブルに出力します。そして、私は現在削除オプションに取り組んでいます。

ボタンをクリックすると、行のIDが取得され、行のIDがdelete.phpに送信され、削除されます。

しかし、今は問題があります。たとえば、10 行 (10 の異なるクライアント) がある場合、最初の行から ID を取得するたびに、

私のコードの下をチェックして、どこが間違っているのか教えてください。フォームで正しい行 ID を取得できないのはなぜですか。

<?php
    while($row = mysql_fetch_array($result))
    {
    echo "
    <table align='center' width='962px' style='color:#000; font-family:Tahoma;'>
        <tr>
            <td width='5%' height='35'><center><span class='text3'>" . $row['id'] . "</span></center></td>  
            <td width='22%' height='35'><center><span class='text3'>" . $row['imeinpriimek'] . "</span></center></td>
            <td width='18%' height='35'><center><span class='text3'>" . $row['datuminkrajrd'] . "</span></center></td>
            <td width='25%' height='35'><center><span class='text3'>" . $row['datumvnosa'] . "</span></center></td>     
            <td width='30%' height='35'> 

    <form action='delete.php' method='post' id='form'>

    <button type='button' style='border: 0; background: #fff;' onclick=\"popup('Želiš izbrisati spodaj navedenega klienta?<br><br> <b>" . $row['imeinpriimek'] . "</b>')\"><img src='images/delete.png' title='Izbriši'><input type='text' name='id' value='" . $row['id'] . "' /</button>



    <div id='dialog-box'>
    <div class='dialog-content'>
    <div id='dialog-message'></div>

    <button type='submit' onclick=\"$('#form').submit()\" style='border:1px solid #125e94; border-radius: 3px; -moz-border-radius: 3px; font-size:12px; width: 30px; height: 25px; text-align:center; color: #e6e4e2; background: #0397ff;'>Da</button> 

    <button style='border:1px solid #125e94; border-radius: 3px; -moz-border-radius: 3px; font-size:12px; width: 30px; height: 25px; text-align:center; color: #e6e4e2; background: #0397ff;'>Ne</button>
    </form> 
    </div>
    </div>

    </td>
    </tr>
    </table>

    ";
    }
    mysql_close($con);
?>

ありがとう

4

2 に答える 2