0

sorry to ask a basic question. I am new in PHP programming. I have the below code which is crashing when it gets the get_result row. I already tested in my local computer iis installation and works fine. But when I put it to work in the web hosting it crashes. Would you please take a look? I appreciate your support.

    $servername = "localhost";
    $username = "user";
    $password = "pwd";
    $dbname = "db";
    $conn = new mysqli($servername, $username, $password, $dbname);
    // check conn
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
        exit();
    }
    $stmt = $conn->prepare("select * from catusuarios where userid = ?");
    $stmt->bind_param('s', $_POST["userid"]);
    $stmt->execute();
    $result = $stmt->get_result();
    $user = $result->fetch_object();
    $conn->close();

1 Answers1

0

For those having the same issue, the API Extensions under mysqlnd was empty. I went into cPanel >> Select PHP version, and selected nd_mysqli.