Ir para conteúdo

Quencyjones79

Members
  • Total de itens

    3
  • Registro em

  • Última visita

Tudo que Quencyjones79 postou

  1. 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 */;
  2. Quencyjones79

    Interpretação de código PHP!

    Olá boa tarde, sou iniciante na linguagem PHP, embora tenha umas noções básicas do código e estou com algumas dificuldades dúvidas no código que está a cor de laranja, se alguém que perceba de código PHP se me puder ajudar, agradecia imenso a ajuda. <?php include "..\ligacao.php"; ?> <?php $idFunc=$_POST['idFunc']; $NomeAlterado=$_POST['NomeAlterado']; $idLoja=$_POST['idLoja']; $permissao=$_POST['permissao']; if($idLoja=="Selecione..."){ $idLoja=$_POST['idLojaAtual']; } if($permissao==NULL){ $qfunc="UPDATE funcionario SET nome_func='".$NomeAlterado."',id_loja='".$idLoja."' WHERE id_func='".$idFunc."'"; $connfunc=mysqli_query($ligax,$qfunc); }else{ $qfunc="UPDATE funcionario SET nome_func='".$NomeAlterado."',id_loja='".$idLoja."', ativo_func='".$permissao."' WHERE id_func='".$idFunc."'"; $connfunc=mysqli_query($ligax,$qfunc); } if($connfunc==1){ print"<script> alert('Funcionário alterado com sucesso!'); location.href='../inserirfuncionario.php';</script>"; exit; }else{ print"<script> alert('Não foi possível alterar o Funcionário!'); location.href='../inserirfuncionario.php';</script>"; exit; } ?> Atentamente, José Moreira
  3. Quencyjones79

    Interpretação de código PHP!

    Olá boa tarde, sou iniciante na linguagem PHP, embora tenha umas noções básicas do código e estou com algumas dificuldades dúvidas no código que está a cor de laranja, se alguém que perceba de código PHP se me puder ajudar, agradecia imenso a ajuda. <?php include "..\ligacao.php"; ?> <?php $idFunc=$_POST['idFunc']; $NomeAlterado=$_POST['NomeAlterado']; $idLoja=$_POST['idLoja']; $permissao=$_POST['permissao']; if($idLoja=="Selecione..."){ $idLoja=$_POST['idLojaAtual']; } if($permissao==NULL){ $qfunc="UPDATE funcionario SET nome_func='".$NomeAlterado."',id_loja='".$idLoja."' WHERE id_func='".$idFunc."'"; $connfunc=mysqli_query($ligax,$qfunc); }else{ $qfunc="UPDATE funcionario SET nome_func='".$NomeAlterado."',id_loja='".$idLoja."', ativo_func='".$permissao."' WHERE id_func='".$idFunc."'"; $connfunc=mysqli_query($ligax,$qfunc); } if($connfunc==1){ print"<script> alert('Funcionário alterado com sucesso!'); location.href='../inserirfuncionario.php';</script>"; exit; }else{ print"<script> alert('Não foi possível alterar o Funcionário!'); location.href='../inserirfuncionario.php';</script>"; exit; } ?> Atentamente, José Moreira
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.