PHP encountered an error call to a member function Fetch_object ()

Source: Internet
Author: User

1. Check the grammar, no problem

<?php
Require "fun.php";
$KC _sql= "SELECT distinct KCM from KCB";//Find course Name
$conn = new mysqli (' localhost ', ' root ', ' ', ' PXSCJ2 ');
$KC _result=mysqli_query ($conn, $KC _sql); * Select queries return a resultset */
Var_dump ($KC _result);
while ($KC _row= $kc _result->fetch_array (MYSQLI_ASSOC))//* Fetch array */
{
echo "<option>". $kc _row[' KCM '). " </option> "; Export course name to drop-down box
}
?>

2. Using Var_dump output, no results

Var_dump ($KC _result);

3. Search directly in Mysqladmin, results

Select distinct KCM from KCB "

Prompt error, check found field name is Chinese, change to English, on it.

PHP encountered an error call to a member function Fetch_object ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.