有这个2错误mysqli_stmt :: bind_param()&调用未定义的方法mysqli_stmt :: get_result()

时间:2016-01-09 06:19:50

标签: php

遇到mysqli_stmt::bind_param()

的问题
  

调用未定义的方法mysqli_stmt :: get_result()

错误

    // From the SQL query that returns the top 10 most loan asset in the selected asset
    $assetQuery = "SELECT asset_name, num_loan FROM asset ORDER BY asset_name DESC LIMIT 10";

    // Prepare the query statement
    $assetPrepStmt = $dbhandle->prepare($assetQuery);

    // If there is an error in the statement, exit with an error message
    if($assetPrepStmt === false) {
        exit("Error while preparing the query to fetch data from asset Table. ".$dbhandle->error);
    }

    // Bind the parameters to the query prepared
    $assetPrepStmt->bind_param("s", $assetName);

    // Execute the query
    $assetPrepStmt->execute();

    // Get the results from the query executed
    $assetResult = $assetPrepStmt->get_result();

0 个答案:

没有答案