php - Delete the respective button -


 <?php     include "ludigidb.php";     session_start();     if ( !isset( $_session['user'] ) && $_session['user'] == "") {        header("location:admin.php");     }        $db = new ludigi_db ();        $jk = $db->do_some_magic($db->run_q("select * emc_leadgen order emc_time_date desc" ));        $g=count($jk);        $colnames =array();     if (count($jk) > 0) {     foreach($jk[0] $k=>$v)        $colnames[] = $k;  }?>  <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"> <html> <head> welcome <?=$_session['user']?></br> <a href="logout.php" >log-out</a></br> <title> emc promo 1</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> </head> <body>          <b>the total no rows :</b><?=$g?>         <table cellpadding="5" border="1" style="width:450px;"><tr> <?php   ($i=0; $i < count($colnames); $i++) { ?>         <td><?=$colnames[$i]?></td> <?php   }?>         <td>delete</td>         <td>edit</td>         </tr> <?php   ($i=0; $i < count($jk); $i++) { ?>         <tr> <?php   ($ii=0; $ii < count($colnames); $ii++) {?>         <td><?=$jk[$i][$colnames[$ii]]?></td> <?php  }?>         <td><form action="del.php" method="post">         <input type='hidden' name='id' value= <?php echo $jk[$i];?>>             <input type="submit" name="downld" value="delete" >            </form></td>            <td><form action="edit.php" method="post">            <input type="hidden" name="id1" value="<?=$jk['$i'];?>">            <input type="submit" name="downld" value="update " >            </form></td>           </tr> <?php } ?>           </table>           </body>           </html> 

as can see in program, i'm making table column names , respective values coming. have made delete , edit button. in delete or edit button i'm passing hidden value, ie $jk[$i].

i solve problem, passing column values check able delete , update user details easily.


Comments