Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: Cod.wiz
- * Date: 1/16/2019
- * Time: 9:56 PM
- */
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "mydb";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- // form is the column (double checked it)
- $sql = "SELECT * FROM form;";
- // 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
- // code here
- $result = mysqli_query($conn, $sql);
- $resultCheck = mysqli_num_rows($result);
- // below is the line 27
- if ($resultCheck > 0) {
- while ($row = mysqli_fetch_assoc($result)) {
- // value1 is the row name from which I want to show data from
- echo $row['value1' . '<br>'];
- }
- }
- /*
- Notice: Undefined index: id
- in C:\xampp\htdocs\form\show.php on line 27
- Notice: Undefined index: id
- in C:\xampp\htdocs\form\show.php on line 27
- Notice: Undefined index: id
- in C:\xampp\htdocs\form\show.php on line 27
- Notice: Undefined index: id
- in C:\xampp\htdocs\form\show.php on line 27
- */
Add Comment
Please, Sign In to add comment