Catchable fatal error: Object of class mysqli_result could not be conv
Boa noite a todos,
Estou com o seguinte erro:
• Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\xampp\htdocs\.................
$conn = mysqli_connect("localhost", "root", "", "acervo");
$id_arq = mysqli_query($conn, "SELECT ARQ_ID FROM arquivos ORDER BY ARQ_DT_PUB DESC LIMIT 1");
ou
$joga_banco = $_FILES['arquivo']['name']; ou até mesmo $joga_banco = "wer";
$id_arq = mysqli_query($conn, "SELECT ARQ_ID FROM arquivos WHERE='$joga_banco'");
O mesmo ocorre com singleton:
include(conexao2.php); //abaixo:
<?php
Class Connection {
private $_conn;
public $query;
public $result;
public $num_rows;
public static $db;
private function __construct()
{
$this->_conn = mysqli_connect("localhost", "root", "", "acervo");
if (!$this->_conn)
{
print mysqli_error();
}
}
public static function getInstance() {
if (!self :: $db) {
self :: $db = new Connection();
}
return self :: $db;
}
public function query($sql)
{
if (!$this->query = mysqli_query($this->_conn,$sql))
{
print mysqli_error(); // mesmo que or die
}
return $this->query;
}
public function __destruct()
{
@mysql_close($this->_conn);
}
}
?>
HELPPPPP
Discussão (2)
Carregando comentários...