相关疑难解决方法(0)

如何在不同的环境中获取MySQLi错误信息

在我的本地/开发环境中,MySQLi查询执行正常.但是,当我在我的Web主机环境中上传它时,我收到此错误:

致命错误:在...中的非对象上调用成员函数bind_param()

这是代码:

global $mysqli;
$stmt = $mysqli->prepare("SELECT id, description FROM tbl_page_answer_category WHERE cur_own_id = ?");
$stmt->bind_param('i', $cur_id);
$stmt->execute();
$stmt->bind_result($uid, $desc);
Run Code Online (Sandbox Code Playgroud)

为了检查我的查询,我试图通过控制面板phpMyAdmin执行查询,结果是OK.

php environment mysqli error-reporting prepared-statement

85
推荐指数
1
解决办法
1万
查看次数

Flutter List 不是“Iterable<dynamic>”类型的子类型

我是 Flutter 开发的新手。我收到错误

列表不是“Iterable”类型的子类型

到目前为止我已经做到了这一点。

模型类

class Categories {
final String title;
final Items items;

Categories({this.title, this.items});

 factory Categories.fromJson(Map<String, dynamic> json) {
  return new Categories(
    title: json['title'],
    items: Items.fromJson(json['Items']));
  }
}

class Items {
final String tag;
final String childId;
final String category;
final String isNew;

Items({this.tag, this.childId, this.category, this.isNew});

factory Items.fromJson(Map<String, dynamic> json) {
return new Items(
    tag: json['id'],
    childId: json['child_category_id'],
    category: json['category'],
    isNew: json['new']);
 }}
Run Code Online (Sandbox Code Playgroud)

缅因州内舱

List<Categories> categories = [];
var loading = false;

 Future<Null> getNavigationItems() async { …
Run Code Online (Sandbox Code Playgroud)

json dart flutter

5
推荐指数
1
解决办法
7180
查看次数