Jump to content
Larry Ullman's Book Forums

tautuxs9

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by tautuxs9

  1. 23 minutes ago, tautuxs9 said:

    Hey guys. I need help with the program. I get error Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\index.php on line 15

    Here is my code: 

    1st file.

    <?php
        include_once 'includes/DuombazesInfo.php'
    ?>

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
    </head>
    <body>

    <?php
        $sql = "SELECT * FROM vartotojai";
        $result = mysqli_query($con, $sql);
        $resultCheck = mysqli_num_rows($result);

        if ($resultCheck > 0) {
            while ($row = mysqli_fetch_assoc($result)) {
                echo $row['vartotojas_vardas'];
            }
        }
    ?>

    </body>
    </html>

    2nd file.

    <?php

    $dbServername = "localhost";
    $dbUsername = "root";
    $dbPassword = "";
    $dbName = "duombaze";

    $con = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbPassword);

     

    23 minutes ago, tautuxs9 said:

    Hey guys. I need help with the program. I get error Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\index.php on line 15

    Here is my code: 

    1st file.

    <?php
        include_once 'includes/DuombazesInfo.php'
    ?>

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
    </head>
    <body>

    <?php
        $sql = "SELECT * FROM vartotojai";
        $result = mysqli_query($con, $sql);
        $resultCheck = mysqli_num_rows($result);

        if ($resultCheck > 0) {
            while ($row = mysqli_fetch_assoc($result)) {
                echo $row['vartotojas_vardas'];
            }
        }
    ?>

    </body>
    </html>

    2nd file.

    <?php

    $dbServername = "localhost";
    $dbUsername = "root";
    $dbPassword = "";
    $dbName = "duombaze";

    $con = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbPassword);

    Don't need no more. Fixed myself

  2. Hey guys. I need help with the program. I get error Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\index.php on line 15

    Here is my code: 

    1st file.

    <?php
        include_once 'includes/DuombazesInfo.php'
    ?>

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
    </head>
    <body>

    <?php
        $sql = "SELECT * FROM vartotojai";
        $result = mysqli_query($con, $sql);
        $resultCheck = mysqli_num_rows($result);

        if ($resultCheck > 0) {
            while ($row = mysqli_fetch_assoc($result)) {
                echo $row['vartotojas_vardas'];
            }
        }
    ?>

    </body>
    </html>

    2nd file.

    <?php

    $dbServername = "localhost";
    $dbUsername = "root";
    $dbPassword = "";
    $dbName = "duombaze";

    $con = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbPassword);

×
×
  • Create New...