Advertisement
michaelyuen

Untitled

Jun 15th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. if (mysqli_num_rows($result) > 0 ) {
  3.         while ($row = mysqli_fetch_array($result)) {
  4.                 // use a common name for variable so that your team can pick up your codes easier
  5.                 $id = $row['id'];
  6.                 $name = $row['name'];
  7.                 $phone = $row['phone'];
  8.                 // prepare your variable to avoid mixing quotes and concatenation
  9.                 echo "<tr>
  10.                 <td>
  11.                     <input type='hidden' name='id' value = '$id' />
  12.                     <input type='text'   name= 'name' value= '$name' />
  13.                 </td>
  14.                 <td>
  15.                     <input type='text' name='phone' value = '$phone' / >
  16.                 </td>
  17.                 </tr>";
  18.         }
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement