keymasterviriya1150

update2

Apr 4th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.24 KB | None | 0 0
  1. <?php
  2.        echo "<center>";
  3.        $data=array("Room_id &nbsp &nbsp &nbsp &nbsp &nbsp","Floors &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp","Price &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp","Single/Double","Room Type &nbsp &nbsp &nbsp","Room Type &nbsp &nbsp &nbsp");
  4.  
  5.        $data1=array("text1","text2","text3","text4","text5","text6");
  6.  
  7.     $con=mysqli_connect("localhost","root","","hotel");
  8.     if($con!=null)
  9.         echo"Sucess";
  10.     $result=mysqli_query($con,"SELECT * FROM room  WHERE Room_id=".$_POST['id']." ");
  11.     if(!$result)
  12.         die("connot");
  13.  
  14.     while($row=mysqli_fetch_array($result,MYSQLI_NUM))
  15.     {
  16.         echo "<form name='form' method='post' action='update3.php'>";
  17.           for ($i=0; $i < 5 ; $i++)
  18.           {
  19.               if($i==0)
  20.               {
  21.                 echo $data[$i]."<input type='text' value='".$row[$i]."' name='$data1[$i]' disabled><br><br>";
  22.                 echo '<input type="hidden" name="id" value="'.$row[0].'">';
  23.               }
  24.               else
  25.                 echo $data[$i]."<input type='text' value='".$row[$i]."' name='$data1[$i]'><br><br>";
  26.         }
  27.  
  28.           echo"<input type='submit' name='submit' value='update'>";
  29.         echo "</form>";
  30.     }
  31.     echo "</center>";
  32.    
  33. ?>
Add Comment
Please, Sign In to add comment