Jump to content
Fórum Script Brasil
  • 0

Converter para String


Question

Tenho esta duvida,

Tenho um arquivo e me sae este erro ao guardar os dados na base de dados:

Recoverable fatal error: Object of class mysqli could not be converted to string in C:\xampp\htdocs\escola\processa\proc_cad_usuario.php on line 12

A minha linha 12:  $query = mysqli_query("$conn,INSERT INTO usuarios(nome,email,login,senha,nivel_acesso_id,created)VALUES

Aqui esta o codigo do ficheiro:

 

<?php
session_start();
include_once("../seguranca.php");
include_once("../conexao.php");

$nome                 = $_POST["nome"];
$email                 = $_POST["email"];
$usuario             = $_POST["usuario"];
$senha                 = $_POST["senha"];
$nivel_de_acesso     = $_POST["nivel_de_acesso"];

$query = mysqli_query("$conn,INSERT INTO usuarios(nome,email,login,senha,nivel_acesso_id,created)VALUES ('$nome','$email','$usuario','$senha','$nivel_de_acesso',NOW())");
if(mysqli_affected_rows() !=0){
    header("Location: ../listar_usuario.php");
}
?>

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing


  • Forum Statistics

    • Total Topics
      148692
    • Total Posts
      644524
×
×
  • Create New...