Guest User

show.php

a guest
Jan 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: Cod.wiz
  5.  * Date: 1/16/2019
  6.  * Time: 9:56 PM
  7.  */
  8.  
  9.  /*
  10.   * ye mujha add krna prh rh afile chalany k lia
  11. $servername = "localhost";
  12. $username = "root";
  13. $password = "";
  14. $dbname = "mydb";
  15.  
  16. $conn = new mysqli($servername, $username, $password, $dbname);
  17. */
  18.  // form is the column (double checked it)
  19. $sql = "SELECT * FROM form;";
  20. // was getting a $conn not defined error which resides into another file , had included it with include_once "connect.php". But error so moved the
  21. // code here
  22. // trouble krna wala ye variable ha $conn
  23. $result = mysqli_query($conn,$sql);
  24. $resultCheck = mysqli_num_rows($result);
  25.  
  26. // below is the line 27
  27.     if ($resultCheck > 0) {
  28.         while ($row = mysqli_fetch_assoc($result)) {
  29.             // value1 is the row name from which I want to show data from
  30.             echo $row['value1'] .'</br>';
  31.         }
  32.     }
  33.  
  34.      /*
  35.  
  36. Notice: Undefined index: id
  37. in C:\xampp\htdocs\form\show.php on line 27
  38.  
  39. Notice: Undefined index: id
  40. in C:\xampp\htdocs\form\show.php on line 27
  41.  
  42. Notice: Undefined index: id
  43. in C:\xampp\htdocs\form\show.php on line 27
  44.  
  45. Notice: Undefined index: id
  46. in C:\xampp\htdocs\form\show.php on line 27
  47.      */
Add Comment
Please, Sign In to add comment