php 遇到报错 Call to a member function fetch_object()
1.检查语法 ,没问题
<?php
require "fun.php";
$kc_sql="select distinct KCM from KCB"; //查找课程名
$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>"; //输出课程名到下拉框中
}
?>
2.使用 var_dump 输出,没有结果
var_dump($kc_result);
3.直接在mysqladmin 里查询,结果
select distinct KCM from KCB"
提示报错,检查发现字段名字是中文的,改成英文的,就可以了。
php 遇到报错 Call to a member function fetch_object()的更多相关文章
- 编译PHP 报错:node.c: In function dom_canonicalization
编译PHP 报错:node.c: In function dom_canonicalization /opt/php-5.2.17/ext/dom/node.c:1953: error: deref ...
- 关于IONIC 报错 XX is not a function
刚开始 做一个项目,总是报错"XX is not a function" 最后发现 原因 , 原来是 服务的 注入位置 有问题. angular.module(" ...
- JS function document.onclick(){}报错Syntax error on token "function", delete this token
JS function document.onclick(){}报错Syntax error on token "function", delete this token func ...
- 使用CI遇到的问题报错:Call to undefined function base_url()
问题来源:在HTML文件中使用base_url()函数引入CSS文件时,发现报错:Call to undefined function base_url() 研究了一下才知道是因为没有加载url小助手 ...
- jquery 报错 $.cookie is not a function()
jquery 报错 $.cookie is not a function() ——我是之前可以运行的项目,突然报这个错误,很奇怪. 这是jquery的cookie插件报错. 插件名: jquery.c ...
- JS function document.onclick(){}报错Syntax error on token "function", delete this token - CSDN博客
原文:JS function document.onclick(){}报错Syntax error on token "function", delete this token - ...
- objc_msgSend()报错Too many arguments to function call ,expected 0,have3
Build Setting--> Apple LLVM 6.0 - Preprocessing--> Enable Strict Checking of objc_msgSend Call ...
- php报错 【 Call to undefined function imagecreatetruecolor()】
刚才在写验证码的时候,发现报错,然后排查分析了一下,原来是所用的php版本(PHP/5.3.13)没有开启此扩展功能. 进入php.ini 找到extension=php_gd2.dll ,将其前面的 ...
- 不知道哪里alert undefined 用下面的语句是js报错.F12能提示报错的地方window.alert=function(aa){ if (typeof (aa)"undefined"){ throw "就是这";}};
不知道哪里alert undefined 用下面的语句是js报错.F12能提示报错的地方 var oldalert=window.alert; window.alert=function(aa){ i ...
随机推荐
- Win8系统如何关闭用户账户控制UAC
按WIN+S,屏幕右侧出现搜索框,在搜索框中输入UAC,然后单击"更改用户账户控制设置" 然后把弹出的窗口改成"从不通知"就可以了
- android事件分发(二)
非常早之前写过一篇android事件分发的博客,主要写的是它是怎样分发的,具体非常多原理的东西都没有涉及到.今天就从源代码看android怎样控制它的分发机制. 鉴于手机屏幕的限制,所以android ...
- Nerv --- React IE8 兼容方案
创建项目 创建一个目录,使用npm快速初始化 $ mkdir my-project && npm init -y 安装依赖 安装webpack以及babel $ npm install ...
- HDU 5288(OO’s Sequence-区间互质情况统计)
OO's Sequence Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) ...
- HTML的简单学习
<html>与</html>之间的部分用来描述网页. <body>与</body>之间是页面的可见的内容. <h1>与</h1> ...
- udhcp源码详解(四) 之租赁IP的管理
Server端对于租赁出去的IP的管理是基于结构体dhcpOfferedAddr的,该结构体的定义是在leases.c文件里:(结构体的成员介绍说明见详解之数据结构) 1: struct dhcpOf ...
- mingw在Dos下升级gnu编译器版本
在dos窗口下输入: mingw-get update mingw-get upgrade gfortran gcc g++ 强烈建议卸载后再安装新版本
- Selenium 工具介绍、安装、配置及使用
概念 selenium是一款跨平台开源工具,用于web的功能完整性測试,想做压力測试的能够换软件了 先看一眼官方站 http://docs.seleniumhq.org/download/ 首先要FQ ...
- 【iOS系列】-A server with the specified hostname could not be found.问题解决
[iOS系列]-A server with the specified hostname could not be found.问题解决 Reveal 在iOS开发中可以方便查看界面的布局,较为方便的 ...
- 【iOS系列】-UIWebView加载网页禁止左右滑动
[iOS系列]-UIWebView加载网页禁止左右滑动 问题: 做项目时候,用UIWebView加载网页的时候,要求是和微信网页中打开的网页的效果一样,也即是只能上下滑动,不能左右滑动,也不能缩放. ...