简体   繁体   English

mysqli和内部联接

[英]mysqli and inner join

I have a problem with this script, I select from 2 tables but I don't know how to bind the result. 我对此脚本有问题,我从2个表中进行选择,但我不知道如何绑定结果。

I get this error : 我收到此错误:

Fatal error: Call to a member function bind_result() on a non-object 致命错误:在非对象上调用成员函数bind_result()

This is my code : http://pastebin.com/5sShTSMC 这是我的代码: http : //pastebin.com/5sShTSMC


<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');


function connect() {
    $mysql = new mysqli('localhost', 'root', '', 'database') or die('Der var et problem med at connecte til databasen');
    return $mysql;
}

First check if your query is correct (all tables and columns exists), i think you missed something there. 首先检查您的查询是否正确(所有表和列均存在),我认为您错过了那里的东西。 Use a var_dump to check if $stmt is a object or a FALSE . 使用var_dump检查$stmt是对象还是FALSE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM