keymasterviriya1150

deldatabase

Apr 14th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2.     $con=mysqli_connect("localhost","root","","hotel");
  3.     if($con!=null)
  4.         echo"Sucess";
  5.     $result=mysqli_query($con,"SELECT * FROM room");
  6.     if(!$result)
  7.         die("connot");
  8.     else
  9.     {
  10.       $data=array("Room_id","Floors","Price","SD","Room_Type",);
  11.         echo'<table border="1">';
  12.            echo '<tr>';
  13.                for ($i=0; $i < 5; $i++)
  14.                  echo '<td>'.$data[$i].'</td>';
  15.                echo "<td>".'update'."</td>";
  16.            echo '</tr>';
  17.     }
  18.     while($row=mysqli_fetch_array($result,MYSQLI_NUM))
  19.        {
  20.            echo '<form name="frmDelete'.$row[0].'" method="post" action="edit.php">';
  21.            echo '<tr>';
  22.            for($i=0;$i<5;$i++)
  23.                echo'<td>'.$row[$i].'</td>';  
  24.             echo '<input type="hidden" name="id" value="'.$row[0].'">';
  25.             echo '<td><input name="smtDelete" type="submit" value="update"></td>';
  26.             echo '</tr>';
  27.             echo '</form>';  
  28.        }
  29.    echo "</table>";
  30.    $result=mysqli_close($con);
  31. ?
Advertisement
Add Comment
Please, Sign In to add comment