-1
Php user.
#Conexao/categoria.php
include_once 'conexao.php';
class UsuarioDAO{
public function Inserir(Usuario $usu){
try{
if (!empty($usu->getNome())){
$sql = "INSERT INTO usuario (nome) VALUES (:n)";
$sp_sql = Conexao::getInstance()->prepare($sql);
$sp_sql->bindValue(":n", $usu->getNome());
return $sp_sql->execute();
}
else{
return false;
}
} catch (Exception $e){
print $e->getMessage();
}
}
userObj.php
<?php
//Controller/categoriaObj.php
include_once '..\Model\usuario.php';
include_once '..\Conexao\usuario.php';
$id = $_POST['id'];
$nome = $_POST['nome'];
$email = $_POST['email'];
$senha = $_POST['senha'];
//instanciar o objeto
$usu = new Usuario($id, $nome, $email, $senha);
$usuDAO = new UsuarioDAO();
//Chamar o método para mostrar a tabuada
$usuDAO->Inserir($usu);
?>
you need to be clearer, your question is too vague.
– Marcos Vinicius