php - Deleting rows from table on web retrieved from database -


I am having trouble removing rows from a database that I have seen on my website, Used and should be removed when multiplier is selected. But this is not happening just now! Nothing is going to be removed from the database! Please help! & lt; form method = "" action = "tester.php" & gt; & Lt ;? Include php 'connect_to_mysql.php'; $ Count = 0; $ = Mysql_num_rows ($ result) count; $ Result = mysql_query ("Choose from the booking order by the ADC select"); Akho "& lt; Table border = '1' & gt; & lt; tr & gt; <<>

  • & Lt; th & gt; Email ID & lt; / th & gt; & lt; th & gt; Phone Number & lt; th & gt; Archive Address & lt; / th & gt; & lt; th & gt; Collection Time & lt; / th & gt; & lt; th & gt; Make & Model & lt; / th & Gt; Th & gt; Message & lt; / th> & lt; / tr & gt; "; While ($ line = mysql_fetch_array ($ result)) {? & Gt; & Lt; Td align = "center" bgcolor = "#fffff" & gt; Input name = "Delete _these []" type = "checkbox" id = "checkbox []" value = " & Lt ;? Php echo "& lt; td & gt;" . $ Line ['name'] "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['email'] "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['phononumber'] "& lt; / td> gt; Echo "& lt; td & gt;" . $ Line ['collection'] "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['collection'] "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['collection time']. "& Lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['maçodel'] "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['message'] "& lt; / td> gt; Echo "& lt; / tr & gt;"; } Resonates "& lt; / table & gt;"; ? & Gt; & Lt; Br> & Lt; Td colspan = "5" align = "center" bgcolor = "#fffff" & gt; Input name = "delete" type = "submit" id = "delete" value = "delete" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt ;? Php // Check that the Delete button is active, then start it (if isset ($ _gET ['delete'])) {for ($ i = 0; $ i & lt; $ count; $ i ++) { $ id = (int) $ _ post ['delete_these'] [$ i]; $ Sql ​​= "Where to remove ID from booking ID = '$ id'"; Print_r ($ _ get ['delete_these []']); $ Sql ​​= "Remove ID ($ ID) from booking ID"; Echo "
    SQL: $ sql

    Firstly you can do all implode () Forms gathered from the form AIDS and the query from there.

    Sample code:

      & lt; Form method = "POST" action = "index.php" & gt; & Lt; Table & gt; & Lt ;? Php while ($ row = mysql_fetch_array ($ result)):? & Gt; & Lt; TR & gt; & Lt; Td> & Lt; Input type = "checkbox" name = "delete _these []" value = "& lt ;? php echo $ row ['id'] ;? gt;" / & Gt; & Lt; / TD & gt; & Lt; Td> & Lt ;? Php echo $ line ['name']; ? & Gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt ;? Php timeline; ? & Gt; & Lt; / Table & gt; & Lt; Input type = "submit" name = "delete" value = "delete selected" / & gt; & Lt; / Form & gt; & Lt ;? Php $ selected_values ​​= array (); If (isset ($ _ POST ['delete'])) {$ select_values ​​= $ _POST ['delete_these']; $ Id = intestine (',', $ selected_valued); $ Query = mysql_query ("Remove id id ($ id) from booking"); // it gets - & gt; Remove from booking where id (1, 2, 3, ...)}? & Gt;   

    And whenever you can still, use mysqli or PDO, anyway

  • Comments

    Popular posts from this blog

    Verilog Error: output or inout port "Q" must be connected to a structural net expression -

    jasper reports - How to center align barcode using jasperreports and barcode4j -

    c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -