Jump to content

Archived

This topic is now archived and is closed to further replies.

tatiana schyneider

Dados sumindo apos alguns dias - Delphi x Firebird

Recommended Posts

Oii Pessoal,
Estou com uma aplicação rodando numa rede(servidor x cliente), com o firebird 2.5.
Estranhamente, de uns tempos, notei que ao cadastrar um produto numa semana, faço a venda nele nos dias subsequentes, mas apos umas semanas(ou apos alguns dias) o produto "some" do banco. Ou seja, vou tentar passar novamente e diz que nao existe !!!! Tentei buscar pela descrição, e diz que o bendito não esta la..

Pensei que poderia ser coisa de usuário, mas notei que em outro lugar que estão usando o sistema, ocorreu a mesma coisa.
Pensei que poderia ser algo relacionado ao estoque chegar a ZERO, mas testando vi que nao era isso..

Voces tem alguma ideia do que possa ser?

Share this post


Link to post
Share on other sites

  • Similar Content

    • By janir.matheus
      Bom dia,
       
      Preciso de ajuda ajuda para resolver o problema de SIGSEGV, basicamente tennho um zconection dentro de uma classe e recebo erro quando tento acessá-lo. Segue um trecho da classe:
      unit unt_classconexao; {$mode objfpc}{$H+} interface uses Classes, SysUtils, ZConnection, ZDataset; type { tConexao } tConexao = class private public vConector : TZConnection; function Listar_Usuarios:TZReadOnlyQuery; procedure Conectar_Banco; end; implementation { tConexao } function tConexao.Listar_Usuarios: TZReadOnlyQuery; var zrquery : TZReadOnlyQuery; begin Conectar_Banco; try zrquery := TZReadOnlyQuery.Create(nil); zrquery.Connection := vConector; zrquery.SQL.Clear; zrquery.SQL.Text := 'SELECT * from tbl_profissionais'; zrquery.Open; Listar_Usuarios := zrquery; finally end; end; procedure tConexao.Conectar_Banco; begin //vConector := TZConnection.Create(nil); vConector.HostName := 'localhost'; vConector.Port := 3306; vConector.Database := 'Caps'; vConector.Protocol := 'mysql-5'; vConector.User := 'root'; vConector.Password := ''; vConector.Connected := true; end; end. Após isso tento fazer uso dessa classe para popular um DBGrid:
      unit unt_frmprincipal; {$mode objfpc}{$H+} interface uses Classes, SysUtils, DB, Forms, Controls, Graphics, Dialogs, Menus, DBGrids, ZConnection, unt_classconexao; type { Tfrm_principal } Tfrm_principal = class(TForm) DataSource1: TDataSource; DBGrid1: TDBGrid; MainMenu_frmPrincipal: TMainMenu; MenuItem_AplicativoSair: TMenuItem; N1: TMenuItem; MenuItem_AplicativoLogin: TMenuItem; MenuItem_Aplicativo: TMenuItem; procedure MenuItem_AplicativoLoginClick(Sender: TObject); private public vConexao : tConexao; end; var frm_principal: Tfrm_principal; implementation {$R *.lfm} { Tfrm_principal } procedure Tfrm_principal.MenuItem_AplicativoLoginClick(Sender: TObject); begin //vConexao := tConexao.Create; DataSource1.DataSet := vConexao.Listar_Usuarios; end; end. A mensagem de erro que recebo dá a entender que o problema ocorre logo que o zconnection começa a ser configurado, como vocês podem ver pelos trechos comentados eu tentei instanciar o componente também sem sucesso. Não tenho experiencia com POO e tenho certeza que estou cometendo um erro bobo, então peço uma explicação sobre como resolver isso. Agradeço de antemão a quem puder me ajudar.
       
      PS. Estou usando o Lazarus.
    • By rafaelpereirap
      Olá, venho pedir ajuda. Estou fazendo um painel admin e no módulo de notícias criei um formulário pra inserir a nova notícia com um campo para inserir a imagem. Criei vários cases para me mostrar se foi feito ou não o registro e agora está dando uma das mensagens do case que não registrou a notícia e não salva a imagem na página indicada. Se puderem me ajudar com esse problema fico agradecido. Seguem os códigos: 
      <?php class connectMysql { private $host = 'localhost'; private $user = 'root'; private $password = 'Be15se90@';//'admin'; private $banco = 'siteNovoCoopama'; private $mysqli = ''; private $insertId = ''; public function __construct(){ } private function mysqlConnect() { $this->mysqli = new mysqli($this->host, $this->user, $this->password, $this->banco); if (mysqli_connect_error()) { die('FATAL ERROR: Can not connect to SQL Server.'); exit(); } } public function executeQuery($query) { $this->mysqlConnect(); // $query = mysqli_real_escape_string($this->mysqli, $query); $this->result = $this->mysqli->query($query); //$this->insertId = mysqli_insert_id(); $this->mysqlClose(); return $this->result; } public function mysqlClose() { $this->mysqli->close(); } /* * vai remover caso tente um sql injection * */ public function limparString($sql) { $sql = addslashes($sql); return $sql; } } noticiaNovo.php
      <?php include ($_SERVER['DOCUMENT_ROOT'] . '/_constantes.php'); //include (RAIZ_SITE . '/protecao.php'); require_once $_SERVER['DOCUMENT_ROOT'] . '/connectMysql.php'; //include_once ($paths['Controller'] . 'NoticiasController.php'); //include 'Controller/NoticiasController.php'; /* * uma dica... esse eh o form pra cadastrar noticias, correto? * isso mesmo, na verdade eu fiz a chamada de inserção e as outras funções no DAO mas não to conseguindo chamar ele, está gerando erro * ai ia tentar dessa maneira para ver se inseria . * mesmo que faca desse jeito, nunca coloque o insert na mesma pagina do form pq você tem que submeter a pagina pra ela mesma com o form carregado * e se a pessoa ficar dando f5, vai ficar cadastrando a mesma noticia qtas vezes ela atualizar a pagina * se quiser fazer dessa forma, sem o DAO, cria uma nova pagina para submeter o form e depois, redireciona para a pagina da noticia * entendue? * criar tipo um validar.php né? * mas queria aprender dessa maneira, orientada, uma puxando a outra * bora fazer rsss * bora lá kkkkk * as chamadas no DAO ta certo? */ ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Coopama | Admin</title> <link rel="shortcut icon" href="/admin/dist/img/favicon.png"> <!-- Google Font: Source Sans Pro --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback"> <!-- Font Awesome --> <link rel="stylesheet" href="<?=HOST_ADMIN?>/plugins/fontawesome-free/css/all.min.css"> <!-- Theme style --> <link rel="stylesheet" href="<?=HOST_ADMIN?>/dist/css/adminlte.min.css"> <!-- summernote --> <link rel="stylesheet" href="<?=HOST_ADMIN?>/plugins/summernote/summernote-bs4.min.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> </head> <body class="hold-transition sidebar-mini"> <div class="wrapper"> <!-- Navbar --> <nav class="main-header navbar navbar-expand navbar-white navbar-light"> <!-- Left navbar links --> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a> </li> <li class="nav-item d-none d-sm-inline-block"> <a href="home.php" class="nav-link">Home</a> </li> <!--<li class="float float-sm-right"> <a href="#" class="nav-link float-right">Contato</a> </li>--> </ul> </nav> </div> <!-- Main Sidebar Container --> <aside class="main-sidebar sidebar-dark-primary elevation-4"> <!-- Brand Logo --> <a href="home.php" class="brand-link"> <img src="dist/img/logo-quadrada-transparente.png" alt="Coopama" class="brand-image img-circle elevation-3" style="opacity: .8"> <span class="brand-text font-weight-light">Coopama</span> </a> <!-- Sidebar --> <div class="sidebar"> <!-- Sidebar user (optional) --> <div class="user-panel mt-3 pb-3 mb-3 d-flex"> <div class="image"> <img src="dist/img/avatar5.png" class="img-circle elevation-2" alt="User Image"> </div> <div class="info"> <a href="#" class="d-block"><?php echo $_SESSION['nome'];?></a> </div> </div> <!-- Sidebar Menu --> <nav class="mt-2"> <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-newspaper nav-icon"></i> <p> Noticias <i class="fas fa-angle-left right"></i> <span class="right badge badge-danger">News</span> </p> </a> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="far fa-newspaper fa-xs nav-icon"></i> <p> Noticias Coopama <i class="fas fa-angle-left right"></i> </p> </a> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="noticiaNovo.php" class="nav-link"> <i class="fas fa-plus nav-icon"></i> <p>Inserir uma nova</p> </a> </li> </ul> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="listaNoticia.php" class="nav-link"> <i class="fas fa-list nav-icon"></i> <p>Listar Todas</p> </a> </li> </ul> </li> </ul> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-journal-whills fa-xs nav-icon"></i> <p> Coopama Informa <i class="fas fa-angle-left right"></i> </p> </a> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-plus nav-icon"></i> <p>Inserir uma nova</p> </a> </li> </ul> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-list nav-icon"></i> <p>Listar Todas</p> </a> </li> </ul> </li> </ul> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-ethernet fa-xs nav-icon"></i> <p> Coopama Informa - Web <i class="fas fa-angle-left right"></i> </p> </a> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-plus nav-icon"></i> <p>Inserir uma nova</p> </a> </li> </ul> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-list nav-icon"></i> <p>Listar Todas</p> </a> </li> </ul> </li> </ul> <li class="nav-item"> <a href="#" class="nav-link"> <i class="nav-icon far fa-calendar-alt"></i> <p> Eventos <i class="fas fa-angle-left right"></i> <span class="badge badge-info right">!</span> </p> </a> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Feiras Coopama</p> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>AGO</p> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Concurso de Café</p> </a> </li> <!--<li class="nav-item"> <a href="#" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Calendário</p> </a> </li>--> </ul> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="nav-icon fas fa-columns"></i> <p> Banners </p> </a> <li class="nav-item"> <a href="#" class="nav-link"> <i class="nav-icon fas fa-tree"></i> <p> Cotação Geral <i class="fas fa-angle-left right"></i> </p> </a> <ul class="nav nav-treeview"> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-tractor nav-icon"></i> <p>Milho</p> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-coffee nav-icon"></i> <p>Café</p> </a> </li> </ul> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="nav-icon fas fa-columns"></i> <p> Trabalhe Conosco </p> </a> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="nav-icon fas fa-calendar-alt"></i> <p> Calendario <span class="badge badge-info right"></span> </p> </a> </li> </ul> </nav> </div> </div> <!-- /.sidebar --> </aside> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1>Noticias</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="home.php">Home</a></li> <!--<li class="breadcrumb-item active"></li>--> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <h3 class="card-title" style="width: 100%">Crie uma nova noticia</h3> </div> <!--<div id="corpoNoticia"class="row">--> <!--<h2 class="center" align="center" style="cursor: pointer"><u>Crie uma nova noticia</u></h2>--> <br style="clear: both"> <form name="novaNoticia" id="novaNoticia" method="post" enctype="multipart/form-data" style="text-align: center"> <input type="hidden" name="acao" id="acao" value="novaNoticia"> <div class="form-row"> <div class="form-group col-lg-6"> <label for="titulo">*Titulo</label> <input type="text" class="form-control" id="titulo" name="titulo" placeholder="Titulo da Noticia" required> </div> <div class="form-group col-md-6"> <label for="previa">Prévia</label> <input type="text" class="form-control" id="previa" name="previa" placeholder="Prévia da Noticia"> </div> </div> <div class="form-group"> <label for="texto">*Texto</label> <textarea class="form-control" id="texto" name="texto" placeholder="Texto da Noticia" required></textarea> </div> <div class="form-row"> <div class="file-field input-field col s12 l8"> <label for="imagem">Imagem Destaque</label> <input type="file" class="form-control" required name="imagemDestaque" id="imagemDestaque"> </div> <div class="form-group col-md-2"> <label for="data">*Data da Postagem</label> <input type="date" class="form-control" name="data" id="data" required> </div> <div class="form-group col-md-2"> <label for="status" required>*Status</label> <select id="status" name="status" class="form-control"> <option selected>Escolher...</option> <option value="A">Ativa</option> <option value="R">Rascunho</option> <option value="D">Descartada</option> </select> </div> <div class="form-group col-md-1"> <label for="fixa">*Topo?</label> <select name="fixa" required id="fixa" class="form-control"> <option value="S">Sim</option> <option value="N">Não</option> </select> </div> <div class="form-group col-md-4" style="text-align: center; margin-top: 30px"> <button type="submit" id="btnSubmit" class="btn btn-group-lg" style="color: white; background-color: #0f9d58">Enviar</button> </div> </div> <!--<hr>--> <!--<button type="submit" class="btn btn-primary" style="color: white; background-color: #0f9d58; " >Enviar</button>--> </form> <br> </div> </div> </div> </div> </section> <style> form { padding-right: 10px; padding-left: 10px; } .form-row{ font-weight: bold; } card-header{ grid-template-rows: 120px 1fr 60px; } label{ padding-left: 5px; padding-right: 5px; } button{ color: #fff; background-color: #0f9d58; padding-bottom: 50px; } form > label{ font-size: 1.0rem; padding-right: 55px; } </style> <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Control sidebar content goes here --> </aside> <!-- /.control-sidebar --> </div> <!-- ./wrapper --> <!-- jQuery --> <script src="/admin/js/jquery-3.6.0.min.js"></script> <!-- Bootstrap 4 --> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.1/dist/umd/popper.min.js" integrity="sha384-SR1sx49pcuLnqZUnnPwx6FCym0wLsk5JZuNx2bPPENzswTNFaQU1RDvt3wT4gWFG" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.min.js" integrity="sha384-j0CNLUeiqtyaRmlzUHCPZ+Gy5fQu0dQ6eZ/xAww941Ai1SxSY+0EQqNXNE6DZiVc" crossorigin="anonymous"></script> <script src="//cdn.jsdelivr.net/npm/sweetalert2@10"></script> <script> $(function (){ $(".preloader").fadeOut(); /*$.post('/processa/acaoNoticias.php',{ acao: 'validarCadastro', }, function (data){ if(data['tipo'] == 'sucess'){ $('#btnSubimit').hide(); Swal.fire({ title: data['titulo'], html: data['mensagem'], type: data['tipo'], confirmButtonText: "Fechar" }); }else { $('#btnSubimit').show(); } },'json');*/ $('#novaNoticia').submit (function (e){ e.preventDefault(); if ($('#titulo, #previa, #texto, #imagem, #data, #status, #fixa').val() != ''){ //$('#btnSubmit').hide(); $.ajax({ type: "POST", url: '/admin/processa/acaoNoticias.php', dataType: 'json', data: new FormData($('#novaNoticia').get(0)), contentType:false, processData: false, cache: false, success: function (data){ if (data['tipo'] == 'success'){ document.getElementById('novaNoticia'). reset(); } $('#btnSubmit').show(); Swal.fire({ title: data['titulo'], html: data['mensagem'], icon: data['tipo'], confirmButtonText: "Fechar" }); }, error: function (data){ $('#btnSubmit').show(); $('#modal-warning').addClass('hide').fadeOut(5); Swal.fire({ title: data['titulo'], html: data['mensagem'], type: 'error', confirmButtonText: "Fechar" }); } }); }else { Swal.fire({ title: 'Atenção', type:'Info', html: 'Os campos com * são obrigatorios, por favor volte e verifique se você preencheu todos.', confirmButtonText: "Fechar" }) } }) }) <?php if(!empty($_SESSION['MSG_RETORNO'])) { $msgRetorno = $_SESSION['MSG_RETORNO']; echo 'Swal.fire({ title: "' . $msgRetorno['titulo'] . '", html: "' . $msgRetorno['mensagem'] . '", type: "' . $msgRetorno['tipo'] . '", confirmButtonText: "Fechar" });'; /* * Apos mostrar a msg de sucesso ou erro, a sessao é eliminada e nao sera mais chamada. */ unset($_SESSION['MSG_RETORNO']); } ?> </script> </body> </html> classNoticias.php
      <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/admin/connectMysql.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/admin/Beans/Noticias.php'; class classNoticias extends connectMysql { public $titulo = ''; public $texto = ''; public $previa = ''; public $imagem = ''; public $data = ''; public $status = ''; public $fixa = ''; public $codNoticia = ''; /** * classNoticias constructor. */ public function __construct() { } /** * @return array */ public function editaNoticia() { $query = $this->executeQuery("UPDATE noticias SET titulo = '" . addslashes(utf8_decode($this->titulo)) . "', texto = '" . addslashes(utf8_decode($this->texto)) . "', previa = '" . addslashes(utf8_decode($this->previa)) . "', imagem = '" . $this->imagem . "', NOW(), status = '" . $this->status . "', fixaTopo = '" . $this->fixa . "', WHERE codNoticia = '" . (int)$this->codNoticia . "' LIMIT 1"); if ($query == true) { return ['tipo' => 'sucess', 'titulo' => 'Sucesso!', 'mensagem' => 'Noticia modificada!']; } else { return ['tipo' => 'error', 'titulo' => 'Erro!', 'mensagem' => 'Erro ao fazer a edição, tente novamente']; } } public function listaNoticias() { $query = $this->executeQuery("SELECT *, DATE_FORMAT(dataPostagem, '%d/%m/%Y %H:%i') dtHrPostagem FROM noticias ORDER BY dataPostagem DESC"); $return = []; while ($sql = $query->fetch_array()) { $return[] = [ 'codNoticia' => utf8_encode($sql['codNoticia']), 'titulo' => utf8_encode($sql['titulo']), 'texto' => utf8_encode($sql['texto']), 'previa' => utf8_encode($sql['previa']), 'imagemDestaque' => utf8_encode($sql['imagemDestaque']), 'dataPostagem' => utf8_encode($sql['dtHrPostagem']), 'status' => utf8_encode($sql['status']), 'fixaTopo' => utf8_encode($sql['fixaTopo']) ]; } return $return; } public function listaNoticiasByCod() { $query = $this->executeQuery("SELECT *, DATE_FORMAT(dataPostagem, '%d/%m/%Y %H:%i') dtHrPostagem FROM noticias WHERE codNoticia = " . (int)$this->codNoticia . "LIMIT 1"); $return = []; while ($sql = $query->fetch_array()) { $return[] = [ 'codNoticia' => utf8_encode($sql['codNoticia']), 'titulo' => utf8_encode($sql['titulo']), 'texto' => utf8_encode($sql['texto']), 'previa' => utf8_encode($sql['previa']), 'imagemDestaque' => utf8_encode($sql['imagemDestaque']), 'dataPostagem' => utf8_encode($sql['dtHrPostagem']), 'status' => utf8_encode($sql['status']), 'fixaTopo' => utf8_encode($sql['fixaTopo']) ]; } return $return; } public function cadastrarNovaNoticia() { if ($this->fixa == 'S') { $this->executeQuery("UPDATE noticias SET fixa = 'X'"); } $sql = "INSERT INTO noticias (titulo, texto, previa, imagemDestaque, dataPostagem, status, fixaTopo) VALUES ('" . addslashes(utf8_decode($this->titulo)) . "', '" . addslashes(utf8_decode($this->texto)) . "', '" . addslashes(utf8_decode($this->previa)) . "', '" . addslashes(utf8_decode($this->imagem)) . "', NOW(), '" . addslashes(utf8_decode($this->status)) . "', '" . addslashes(utf8_decode($this->fixa)) . "')"; return $this->executeQuery($sql); } } acaoNoticias.php
      <?php $titulo = 'Atenção!'; $mensagem = 'Houve um erro ao acessar esta página, por favor, tente novamente.'; $tipo = 'warning'; $html = ''; if(!empty($_POST['acao'])){ require_once '../../_constantes.php'; require_once RAIZ_SITE_ADMIN . '/Classes/classNoticias.php'; $classNoticias = new classNoticias(); /* * diminuir a quantidade de arquivos dessa forma * utiliza um arquivo desse pra cada modulo (noticas textos, ..) * o que vai determinar o que sera feito, eh o campo acao * veja que ja chamou a classe acima e ja instanciou ela, entao nao precisa chamar mais * o que estiver dentro do switch case, vai ser executado de acordo com o valor da acao */ $conn = new mysqli(HOST, USER, SENHA, BD); switch ($_POST['acao']) { /* * se for uma nova noticia entra neste case */ case 'novaNoticia': { if(!empty($_POST['titulo']) && !empty($_POST['previa']) && !empty($_POST['texto'])) { /* * atribui os valores as variaveis. falta o upload da imagem e os outros campos */ $classNoticias->titulo = $_POST['titulo']; $classNoticias->previa = $_POST['previa']; $classNoticias->texto = $_POST['texto']; $classNoticias->fixa = $_POST['fixa']; $classNoticias->status = $_POST['status']; /* * Verifica se fez o upload da imagem */ $mensagemExiste = 'N'; if (!empty($_FILES['imagemDestaque'])) { /*$extensao = pathinfo(substr($_FILES['imagemDestaque']['name'], PATHINFO_EXTENSION, -4));*/ $extensao = pathinfo($_FILES['imagemDestaque']['name'], PATHINFO_EXTENSION); $mensagemExiste = 'S'; if (array_search(strtolower($extensao), ['jpg', 'png', 'jpeg']) == true) { $nomeImagem = md5(date('dmYHis')) . '.' . $extensao; if (move_uploaded_file(RAIZ_SITE . '/var/www/html/novoSiteCoopama/images/noticias' . $nomeImagem, $_FILES['imagemDestaque']['tmp_name']) == true) { $mensagemExiste = 'V'; $classNoticias->imagem = $nomeImagem; } else { $mensagemExiste = 'X'; } } } /* * salva a noticia */ $retorno = $classNoticias->cadastrarNovaNoticia(); // retorno true ou false do insert if ($retorno == true) { switch ($mensagemExiste) { case 'N': $txt = 'Imagem não selecionada.'; break; case 'S': $txt = 'Noticia não gravada, confira novamente'; break; case 'X': $txt = 'Notícia gravada com sucesso mas houve um erro ao salvar a imagem.'; break; case 'V': $txt = 'Notícia gravada com sucesso.<br>Imagem armazenada com sucesso.'; break; default: $txt = 'Notícia gravada com sucesso mas sem imagem selecionada.'; break; } $tipo = 'success'; $titulo = 'Sucesso!'; $mensagem = $txt; } else { $tipo = 'error'; $titulo = 'Erro!'; $mensagem = 'Erro ao gravar a noticia, por favor, tente novamente.'; } } else { $mensagem = 'Por favor, preencha todos os campos marcados com * para gravar sua notícia.'; } break; } case 'listarNoticias': { $sql = "SELECT codNoticia, titulo, previa, texto, dataPostagem, status, fixaTopo FROM noticias"; $conn = mysqliConnect(); $result = $conn->query($sql); $registros = []; if ($result->num_rows > 0){ while($row = $result->fetch_assoc()){ $registros[] = $row; } }elseif ($conn->error){ echo "Erro: " . $conn->error; } break; } case 'editarNoticias': { break; } case 'localizarNoticia': { break; } default: echo "Erro: " . $conn->connect_error; } } else { // caso tenha cmapo vazio, vai retornar para pagina de cadastro de noticias $tipo = 'warning'; $titulo = 'Atenção!'; $mensagem = 'Por favor, preencha todos os campos e tente novamente.'; } echo json_encode([ 'titulo' => $titulo, 'tipo' => $tipo, 'mensagem' => $mensagem, 'html' => $html, ]);
    • By Carlos Antoliv
      Olá, senhores.
       
      Sei que existem diversos tópicos por aí sobre esse assunto, contudo, não consegui solucionar o problema, mesmo depois de 1 dia tentando fazer algo até simples.
       
      Seguinte, estou pegando o id de um produto e tentando jogar em outra tabela, pelo checkbox.
      ex:
       
      id    produto
      23   lapis
      43  caneta
       
      pelo checkbox, a pessoa escolhe o produto e adicona em uma lista, que é outro banco. Se pessoa selecionar mais de 1 item da lista, o laço só envia para o banco apenas 1 item de qualquer forma.
       
      Vou postar o Código:
       
      Código do INSERT:
       
          $check1 = (isset($_POST["check"]) && $_POST["check"] != null) ? $_POST["check"] : "";     foreach($check1 as $check){                         $stmt = $conexao->prepare("INSERT INTO tb_itemProdKit (fk_tb_kit, fk_usuarios, fk_tb_produtos) VALUES (?, ?, ?)");                  $stmt->bindParam(1, $nome_prod);         $stmt->bindParam(2, $idSessao);         $stmt->bindParam(3, $check);                if ($stmt->execute()) {             if ($stmt->rowCount() > 0) {                 echo "Dados cadastrados com sucesso!";                 $id_prod = null;                 $nome_prod = null;                 $idSessao = null;                 $check = null;                             header("Location: item-produto-kit.php");exit;                              } else {                 echo "Erro ao tentar efetivar cadastro";             }         } else {                throw new PDOException("Erro: Não foi possível executar a declaração sql");         }     } } } catch (PDOException $erro) {         echo "Erro: " . $erro->getMessage();     }    
       
      Agora o código do checkbox:
       
             if ($stmt->execute()) {                 while ($rs = $stmt->fetch(PDO::FETCH_OBJ)) {                       echo "<tr>";                     echo "<td><input type='checkbox' name='check[]' id='check' value='".$rs->id_prod."'</td><td class='lista_usuario'>".$rs->nome_produto."</td><td class='lista_usuario'>".$rs->desc_prod."</td><td class='lista_usuario'>".$rs->peso_liq_prod                                ."</td>"                                ;                     echo "</tr>";                 }             }else {                 echo "Erro: Não foi possível recuperar os dados do banco de dados";             }     } catch (PDOException $erro) {         echo "Erro: ".$erro->getMessage();     }     echo "</form>"    
          ?>  
       
       
      Está cadastrando apenas 1 item e não múltiplos itens.
       
      abço!!
       
       
       
       
       
    • By Jozimar
      om dia!
       
      Durante a criação de um menu em tempo de execução com um tema aplicado, a descrição do CAPTION das Action estão ficando desconfigurados.
      O erro ocorre apenas quando os menus são criados em tempo de execução, conforme imagem abaixo:
       
      Imagem com o erro.
       
      Abaixo código fonte do executável.
      ----------------------------------------------------------------------------------------------- unit UFormPrincipal; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, System.Actions, Vcl.ActnList, Vcl.Menus, System.ImageList, Vcl.ImgList, cxImageList, cxGraphics, UdmLista, Vcl.ComCtrls, Vcl.ToolWin; type TFormPrincipal = class(TForm) btnAplicar: TButton; btnCarregarTema: TButton; btnCriarMenus: TButton; pgnModulos: TPageControl; ToolBarOne: TToolBar; procedure btnAplicarClick(Sender: TObject); procedure btnCarregarTemaClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure btnCriarMenusClick(Sender: TObject); private { Private declarations } FModuloLista: TdmLista; public { Public declarations } end; var FormPrincipal: TFormPrincipal; implementation Uses Vcl.Styles, Vcl.Themes; {$R *.dfm} procedure TFormPrincipal.btnAplicarClick(Sender: TObject); begin if btnAplicar.Caption = 'Aplicar CARBON' then begin btnAplicar.Caption := 'Aplicar WINDOWS'; TStyleManager.TrySetStyle('Carbon'); end else begin btnAplicar.Caption := 'Aplicar CARBON'; TStyleManager.TrySetStyle('Windows'); end; end; procedure TFormPrincipal.btnCarregarTemaClick(Sender: TObject); begin TStyleManager.LoadFromFile('C:\TST\Tema\Carbon.vsf'); end; procedure TFormPrincipal.btnCriarMenusClick(Sender: TObject); var lMenu: TMainMenu; lItem: TMenuItem; lIndex: iNTEGER; TabSheet: TTabSheet; begin TabSheet := TTabSheet.Create(pgnModulos); TabSheet.PageControl := pgnModulos; TabSheet.Caption := ' - Menu - '; ToolBarOne.Parent := TabSheet; lMenu := TMainMenu.Create(ToolBarOne); lMenu.Images := FModuloLista.ImageList1; lItem := TMenuItem.Create(lMenu); lItem.Caption := ' -- SubMenu -- '; lMenu.Items.Add(lItem); for lIndex := 0 to FModuloLista.ActionList1.ActionCount-1 do begin lItem := TMenuItem.Create(lMenu); lItem.Action := FModuloLista.ActionList1[lIndex]; lMenu.Items[0].Add(lItem); end; ToolBarOne.Menu := lMenu; end; procedure TFormPrincipal.FormCreate(Sender: TObject); begin FModuloLista := TdmLista.Create(Self); end; end. ----------------------------------------------------------------------------------------------- object FormPrincipal: TFormPrincipal Left = 0 Top = 0 Caption = 'Principal' ClientHeight = 428 ClientWidth = 773 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 object btnAplicar: TButton Left = 296 Top = 273 Width = 241 Height = 25 Caption = 'Aplicar CARBON' TabOrder = 0 OnClick = btnAplicarClick end object btnCarregarTema: TButton Left = 177 Top = 273 Width = 113 Height = 25 Caption = 'Carregar Tema' TabOrder = 1 OnClick = btnCarregarTemaClick end object btnCriarMenus: TButton Left = 96 Top = 273 Width = 75 Height = 25 Caption = 'Criar MENU' TabOrder = 2 OnClick = btnCriarMenusClick end object pgnModulos: TPageControl Left = 0 Top = 0 Width = 773 Height = 97 Align = alTop TabOrder = 3 end object ToolBarOne: TToolBar Left = 0 Top = 97 Width = 773 Height = 29 Caption = 'ToolBarOne' TabOrder = 4 Transparent = False StyleElements = [] Wrapable = False end end ----------------------------------------------------------------------------------------------- unit UdmLista; interface uses System.SysUtils, System.Classes, System.ImageList, Vcl.ImgList, Vcl.Controls, cxImageList, cxGraphics, System.Actions, Vcl.ActnList, Vcl.Menus; type TdmLista = class(TDataModule) ActionList1: TActionList; Action1: TAction; Action2: TAction; Action3: TAction; Action4: TAction; ImageList1: TImageList; MainMenuOne: TMainMenu; Novidades1: TMenuItem; Action11: TMenuItem; Action21: TMenuItem; Action31: TMenuItem; Action41: TMenuItem; procedure Action1Execute(Sender: TObject); procedure Action2Execute(Sender: TObject); procedure Action3Execute(Sender: TObject); procedure Action4Execute(Sender: TObject); private { Private declarations } public { Public declarations } end; var dmLista: TdmLista; implementation Uses Vcl.Dialogs; {%CLASSGROUP 'Vcl.Controls.TControl'} {$R *.dfm} procedure TdmLista.Action1Execute(Sender: TObject); begin ShowMessage('1111'); end; procedure TdmLista.Action2Execute(Sender: TObject); begin ShowMessage('2222'); end; procedure TdmLista.Action3Execute(Sender: TObject); begin ShowMessage('3333'); end; procedure TdmLista.Action4Execute(Sender: TObject); begin ShowMessage('4444'); end; end. ----------------------------------------------------------------------------------------------- object dmLista: TdmLista OldCreateOrder = False Height = 240 Width = 442 object ActionList1: TActionList Images = ImageList1 Left = 248 Top = 72 object Action1: TAction Category = 'Dados Unidos' Caption = 'Action1' ImageIndex = 0 OnExecute = Action1Execute end object Action2: TAction Category = 'Dados Unidos' Caption = 'Action2' ImageIndex = 1 OnExecute = Action2Execute end object Action3: TAction Category = 'Dados Unidos' Caption = 'Action3' ImageIndex = 2 OnExecute = Action3Execute end object Action4: TAction Category = 'Dados Unidos' Caption = 'Action4' ImageIndex = 3 OnExecute = Action4Execute end end object ImageList1: TImageList Left = 176 Top = 72 Bitmap = { 494C010104000800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000010102021C1C384520225E791C2265801F2767801C1F607D23244D600B0B 1216000000000000000000000000000000000000000000000000000000000000 00000000000005070B0E5E84BCEA5077B0FF315187FF1A3A65FE02080E2E0000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000010103050E170102070B000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000001010 1B204546A8D64659D8FF7294F5FF83A8FFFF82A7FEFF7B9FFAFF556EE2FF3D43 BAEB1F1F35400000000000000000000000000000000000000000000000000000 00000000000000000000000000005581B8FF325488FF1A3A65FF030B14440000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000407151F15265E8B0C132637000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000001E1E39463E48 B8E05C78EFFF6989F8FF617EF1FF566DE6FF5368E2FF5D78EDFF6989F8FF6381 F4FF4858D7FC282A657F00000000000000000000000000000000000000000000 0000000000000000000000000000426693D334588CFF1A3A65FF030A133D0000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000010103050C111B2D7EA53551CEFA1C2C668B0A1124340102 0508000000000000000000000000000000000000000000000000000000000000 0000000000000B1F0E4118411F8A000000000000000000000000000000000000 000000000000000000000000000000000000000000000E0E171C3337BEF9536B F0FF556EF2FF4458E2FF2F2FB1F631315B6F2525414E3F3F8BB2343BC5FC5069 EEFF5670F4FF4250D6FC1B1B2E37000000000000000000000000000000000000 00000000000000000000000000002E486897365D90FF1A3861F50716287B0815 267003090F2B0000000000000000000000000000000000000000000000000000 000000000101060A172215237EBA405FECFF5578FFFF314AC2EF20325F800E17 2F43010104070000000000000000000000000000000000000000000000000000 000000000000409A5BFF2F803BFF000000000000000000000000000000000000 000000000000000000000000000000000000000000002729718E4051E8FF5D75 F2FF576EF1FF4356ECFF3942D1FA1F20536B00000000000000001515252D3136 97BC4357EAFF4458ECFF353AB9EC0C0C14180000000000000000000000000000 00000000000008101B3C1629469E42699CF3385F93FF244473FF2B4C7FFF3151 86FF35558BFE2336579200000000000000000000000000000000000000000406 0E150E17416021359CCA3C5CEAFF4768F9FF5174F8FF587CF5FF3852C9F32032 7CAA1622435C080D1C280101020400000000000000000000000000000000091D 0B403E9D5EFF70D1A3FF2F803BFF000000000000000000000000000000000000 000000000000000000000000000000000000000000003A3FBAE03A49EEFF3E4D DFFF556BE6FF4556EFFF3A4AEDFF2D34D0FE2B2B4D5D00000000000000001515 252D2C31C5FC3A4AECFF2D37D9FF23234D600000000000000000000000000000 000018284278385991FC3D5E99FF4C75AFFF386295FF243D64C219253B551821 354B344975A15374B9F9080B111700000000000000000000000002030A10131F 6DA02B44D2FF4162F2FF3C5BF3FF3856F1FF3A58F1FF4A6CF4FF5C80F6FF4565 E3FF1B2E9DDF1A2A597E0910273B010104060000000000000000000000003B9C 5BFF6DD4A6FF77D6ABFF2F803BFF358543FF3B8A4BFF409053FF46955AFF4C9A 61FF509E67FF55A16CFF58A471FF00000000000000002E35D8FC2E39EBFF3035 BBE12C2E82A23B48E1FF303AEAFF2C36E8FF282DD3FE21235A6E000000000000 0000404191B22C35E4FF2D37EAFF1719647D0000000000000000000000002635 54745173B7FF46629DD9243351713C5C89C5386094FF1120367C000000000000 000000000000384E7BA22533506A01010202000000000304162316258FC5304B DDFF3C5BEEFF3754ECFF304CEBFF2E49EBFF2E48EBFF324DECFF3E5EECFF5072 F1FF4F71EAFF2C43BCEC14226698060B1F3000000000071C08403A9D5CFF63D0 9EFF6DD4A6FF77D6ABFF74D3A7FF7FD6ADFF88D7B2FF93D9B8FF9CDBBDFFA5DD C2FFADDFC6FF9BCFB3FF58A471FF00000000000000002329DEFF242AE7FF272A 8DA7000000002D3190AE272FE2FF242BE7FF242AE8FF262CD8FE2D2F535F0000 00002627444E252BDEFF252AE8FF11146A800000000000000000000000004C69 A6DB4C6AA7DD090C131900000000263C5782375F92FF0E1C306E000000000000 0000644A30989E7147FF95673DFF724C2BCC000000000E17709F2A43E4FF2F49 E4FF2C45E4FF2740E4FF273FE4FF273FE4FF273FE4FF273FE4FF273FE4FF304B E6FF4667E9FF5072ECFF2237C4FF0910446E00000000389B5AFF5ED09DFF65D2 A1FF6DD4A6FF77D6ABFF80D9B1FF8CDCB8FF96DEBEFFA1E1C5FFABE4CBFFB5E7 D1FFBEE9D6FFA4D4BBFF58A471FF00000000000000001F24E0FF1C1FE6FF2B30 9EB5000000000C0C15182C3194AD2127E1FE1C1FE6FF1C1FE4FF2429DAFE2124 5D6A3437636F2025E1FF1B1FE7FF11156D80000000000506090C192235464D6A A8DE0D111B24000000000000000016213454365D90FF0F1C306D000000000000 0000B3895CFFE2BB89FFD4A568FFB07E48FF00011E421B2CB4E92C45E1FF2439 DEFF2136DDFF2136DDFF2136DDFF2136DDFF2136DDFF2136DDFF2136DDFF2236 DDFF263BDDFF405FE4FF3C5BE2FF0E1771A6000000003C7346C08BE0B9FF65D2 A1FF6DD4A6FF77D6ABFF80D9B1FF8CDCB8FF96DEBEFFA1E1C5FFABE4CBFFB5E7 D1FFBEE9D6FFA4D4BBFF58A471FF00000000000000002C32DDF91A1AE5FF3137 D3ED0000000000000000000000002E3599AE171BE1FF1617E2FF1617E4FF272D DEFC3D48D7F61719E3FF171AE4FF1F246B7900000000835F3DCC9B6D43FF9364 3BFF5539229D000000000000000001010203315086FD11213880000000000000 0000BD9466FFF2D7B4FFE6C295FFBE9363FF02034B7D2339C9FE4264DFFF253C D9FF1A2CD6FF1B2DD6FF1E30D7FF2338D8FF263DD9FF2237D8FF1D2FD6FF1A2C D6FF1A2BD6FF2A43DAFF3A58DFFF101B7FB500000000000000001B6F22FF8BDF B9FF6DD4A6FF77D6ABFF80D9B1FF8CDCB8FF94DDBDFF99DFC0FF99DEC0FF95DC BCFF8CD8B6FF85C9A7FF58A471FF00000000000000002C33B1C5262AE7FF1F23 E3FF3B4296A204040707000000000C0D161830389DAF1C22E3FF1414E2FF1516 E2FF181CE2FF1B1EE4FF212BE4FF1E21404500000000CDA679FFDDB37EFFD09E 5EFF95663CFF0000000000000000000000000F182749142945A6000000000000 00009D7D58CCDEBF9AFFD6B38AFFAB8760E601013D61273CC0F7698DE8FF314A D9FF1422D2FF1624D2FF263DD5FF4363DEFF5E81E4FF5072E1FF314BD8FF1929 D3FF1320D2FF1F33D4FF2A42D7FF0B1271A40000000000000000000000003974 47C083DDB4FF77D6ABFF2F803BFF1A42217E1D44257E2047297E234A2D7E264C 307E284E337E2A50367F2C52398000000000000000002A316C731E26E6FF2F38 E8FF161AE4FF3B4498A2000000000000000000000000323B95A0171BE5FF1414 E2FF171AE4FF2E38E8FF4D58CBD90404060700000000DAB992FFEED1AAFFE1BB 8AFF9F7247FF00000000000000007C5A3AC09D6F45FF96673DFF8C5D35FA2B1C 104F000000000000000000000000000000000000121D1B2AA0D78DAEEFFF5E81 E2FF273FD3FF1E31D1FF263ED3FF3E5DC7F66586BEE5A5C2F2FF7498E8FF3C5A D8FF2237D1FF1522CEFF1625CBFF0407486E0000000000000000000000000000 000024762DFF84DDB4FF2F803BFF000000000000000000000000000000000000 0000000000000000000000000000000000000000000008080E0E3D49B8C33643 ECFF4554EBFF2D37E9FF353EDCED2C33A9B6262E9CA72F38D0E11C23E7FF2F39 E8FF404FECFF3946CFDE0F101B1C0000000000000000BF9F7BE6DCBC95FFD2AE 84FF876442CC0000000000000000CAA375FEDCB37DFFD2A163FFC7914AFF4831 1D7F00000000000000000000000000000000000000000609527A4B68D3FF96B5 F0FF7094E6FF314CD4FF1624C7FF070B5F8E040615274D64B9E391B1EDFF84A7 EBFF486ADBFF1522C9FF080C99E10101111F0000000000000000000000000000 000000000000367648C02F803BFF000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000003E4A B9C1313EEDFF6D87F1FF637CF0FF4253EBFF3743E9FF4B5DECFF728EF2FF5369 EFFF3C4DEEF91F223D3F00000000000000000000000000000000000000000000 0000000000000000000000000000D6B38AFFEACA9FFFDFB784FFD4A568FF4D36 21800000000000000000000000000000000000000000000002040202639D2236 BBFF2841C7FF101AB8FF03035EA300000107000000000000263D0C14A4F32439 BFFF131FBCFF080C91D700000612000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000090A 1010282F6B6D3A47BDC55367EFF95C75F6FF5E77F5FF5A72F3FC4E60D8E02C35 888C111320200000000000000000000000000000000000000000000000000000 0000000000000000000000000000D9BA97F8F6DDBDFFEDCEA6FFE2BC8BFF4E39 2479000000000000000000000000000000000000000000000000000000000101 1E300202355301011F31000000000000000000000000000000000000090E0101 253B0101263D0000090F00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000937552BEC0986AFFBA9163FFAF8559FA3528 1A4E000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000424D3E000000000000003E000000 2800000040000000200000000100010000000000000100000000000000000000 000000000000000000000000FFFFFF0000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000} end object MainMenuOne: TMainMenu Images = ImageList1 Left = 104 Top = 72 object Novidades1: TMenuItem Caption = 'Novidades' object Action11: TMenuItem Action = Action1 SubMenuImages = ImageList1 end object Action21: TMenuItem Action = Action2 SubMenuImages = ImageList1 end object Action31: TMenuItem Action = Action3 SubMenuImages = ImageList1 end object Action41: TMenuItem Action = Action4 SubMenuImages = ImageList1 end end end end O que pode estar causando tal erro ?
    • By Quencyjones79
      Olá a todos, sou novo na área de multimídia. Estou a seguir a um momento um ebook sobre a criação de uma base de dados e também a criação de tabelas. Mas quando vinculei as tabelas do banco de dados, no phpmyadmin me deu alguns erros. Fiz a correspondência da chave primária (artist_id da tabela Artist) com a artist_id da tabela Prints (chave estrangeira) e assim por diante. O problema é que ele não mostra minhas relações das tabelas e me dá uma mensagem de erro. Então, alguns de vocês poderiam me ajudar, por favor, a consertar esta situação. Eu serei grato. Cumprimentos.
       
      Ps .: Abaixo envio o arquivo Sql.
       
      Atentamente,

      José Moreira
      -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 07, 2021 at 08:49 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.2.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `ecommerce` -- -- -------------------------------------------------------- -- -- Table structure for table `artists` -- CREATE TABLE `artists` ( `artist_id` int(10) UNSIGNED NOT NULL, `first_name` varchar(20) DEFAULT NULL, `middle_name` varchar(20) DEFAULT NULL, `last_name` varchar(40) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `customers` -- CREATE TABLE `customers` ( `customer_id` int(10) UNSIGNED NOT NULL, `email` varchar(60) NOT NULL, `pass` char(40) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `order_id` int(10) UNSIGNED NOT NULL, `customer_id` int(10) UNSIGNED NOT NULL, `total` decimal(10,2) UNSIGNED NOT NULL, `order_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `order_contents` -- CREATE TABLE `order_contents` ( `oc_id` int(10) UNSIGNED NOT NULL, `order_id` int(10) UNSIGNED NOT NULL, `print_id` int(10) UNSIGNED NOT NULL, `quantity` tinyint(3) UNSIGNED NOT NULL DEFAULT 1, `price` decimal(6,2) UNSIGNED NOT NULL, `ship_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `prints` -- CREATE TABLE `prints` ( `print_id` int(10) UNSIGNED NOT NULL, `artist_id` int(10) UNSIGNED NOT NULL, `print_name` varchar(60) NOT NULL, `price` decimal(6,2) UNSIGNED NOT NULL, `size` varchar(60) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `image_name` varchar(60) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `artists` -- ALTER TABLE `artists` ADD PRIMARY KEY (`artist_id`), ADD UNIQUE KEY `full_name` (`last_name`,`first_name`,`middle_name`); -- -- Indexes for table `customers` -- ALTER TABLE `customers` ADD PRIMARY KEY (`customer_id`), ADD UNIQUE KEY `email` (`email`), ADD KEY `login` (`email`,`pass`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`order_id`), ADD KEY `customer_id` (`customer_id`), ADD KEY `order_date` (`order_date`); -- -- Indexes for table `order_contents` -- ALTER TABLE `order_contents` ADD PRIMARY KEY (`oc_id`), ADD KEY `order_id` (`order_id`), ADD KEY `print_id` (`print_id`), ADD KEY `ship_date` (`ship_date`); -- -- Indexes for table `prints` -- ALTER TABLE `prints` ADD PRIMARY KEY (`print_id`), ADD KEY `artist_id` (`artist_id`), ADD KEY `print_name` (`print_name`), ADD KEY `price` (`price`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `artists` -- ALTER TABLE `artists` MODIFY `artist_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `customers` -- ALTER TABLE `customers` MODIFY `customer_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `order_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `order_contents` -- ALTER TABLE `order_contents` MODIFY `oc_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `prints` -- ALTER TABLE `prints` MODIFY `print_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
       

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.