par
WENKz » 22 mai 2014, 14:30
Bonjour !
voili voilou
-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le : Jeu 22 Mai 2014 à 05:28
-- Version du serveur: 5.5.35
-- Version de PHP: 5.3.10-1ubuntu3.11
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Base de données: `php`
--
-- --------------------------------------------------------
--
-- Structure de la table `BOUTIQUE`
--
CREATE TABLE IF NOT EXISTS `BOUTIQUE` (
`id_boutique` int(11) NOT NULL AUTO_INCREMENT,
`nom_boutique` varchar(255) DEFAULT NULL,
`type` varchar(33) NOT NULL,
PRIMARY KEY (`id_boutique`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;
--
-- Contenu de la table `BOUTIQUE`
--
INSERT INTO `BOUTIQUE` (`id_boutique`, `nom_boutique`, `type`) VALUES
(12, 'boutique_1', 'INTERNE'),
(13, 'boutique_2', 'EXTERNE');
-- --------------------------------------------------------
--
-- Structure de la table `CATALOGUE`
--
CREATE TABLE IF NOT EXISTS `CATALOGUE` (
`url` varchar(255) DEFAULT NULL,
`prix` decimal(10,2) DEFAULT NULL,
`solde` decimal(11,2) DEFAULT NULL,
`ancien_prix` decimal(10,2) DEFAULT NULL,
`stock` varchar(25) DEFAULT NULL,
`ancien_stock` varchar(25) DEFAULT NULL,
`id_produit` int(11) NOT NULL,
`id_boutique` int(11) NOT NULL,
PRIMARY KEY (`id_produit`,`id_boutique`),
KEY `FK_catalogue_id_boutique` (`id_boutique`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Contenu de la table `CATALOGUE`
--
INSERT INTO `CATALOGUE` (`url`, `prix`, `solde`, `ancien_prix`, `stock`, `ancien_stock`, `id_produit`, `id_boutique`) VALUES
(NULL, 1.20, NULL, NULL, NULL, NULL, 3220, 12),
('url_du_produit_de_la_boutique_2.fr', 1.30, NULL, NULL, NULL, NULL, 3220, 13),
(NULL, 3.00, NULL, NULL, NULL, NULL, 3221, 12);
-- --------------------------------------------------------
--
-- Structure de la table `PRODUIT`
--
CREATE TABLE IF NOT EXISTS `PRODUIT` (
`id_produit` int(11) NOT NULL AUTO_INCREMENT,
`ref` varchar(25) DEFAULT NULL,
`nom_produit` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id_produit`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3222 ;
--
-- Contenu de la table `PRODUIT`
--
INSERT INTO `PRODUIT` (`id_produit`, `ref`, `nom_produit`) VALUES
(3220, 'ACBR-0003', 'Produit_1'),
(3221, 'ACBR-0002', 'Produit_2');
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `CATALOGUE`
--
ALTER TABLE `CATALOGUE`
ADD CONSTRAINT `FK_catalogue_id_boutique` FOREIGN KEY (`id_boutique`) REFERENCES `BOUTIQUE` (`id_boutique`),
ADD CONSTRAINT `FK_catalogue_id_produit` FOREIGN KEY (`id_produit`) REFERENCES `PRODUIT` (`id_produit`);
/*!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 */;
dans ma table boutique je vais recupèrer toute les boutiques de concurrent dont la mienne, dans produit je vais mettre tout mes produit que je vends, dans catalogue je recupère url du concurrent et avec lie a un de mes produit j'insère ensuite leurs prix et leur stock dans ma partie affichage je souhaite faire quelque chose du style
<table>
<thead>
<tr>
<th>Nom produit</th>
<th>Reference</th>
<th>Mon prix</th>
<th>Prix_concurent_1</th>
</tr>
</thead>
<tbody>
<tr>
<td>Produit_1</td>
<td>ACBR-0003</td>
<td>1.3€</td>
<td>1.4€</td>
</tr>
</tbody>
</table>
je vous met juste le html pour avoir l'idée de présentation si ça aide dans mon explication

Bonjour !
voili voilou
[sql]-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le : Jeu 22 Mai 2014 à 05:28
-- Version du serveur: 5.5.35
-- Version de PHP: 5.3.10-1ubuntu3.11
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Base de données: `php`
--
-- --------------------------------------------------------
--
-- Structure de la table `BOUTIQUE`
--
CREATE TABLE IF NOT EXISTS `BOUTIQUE` (
`id_boutique` int(11) NOT NULL AUTO_INCREMENT,
`nom_boutique` varchar(255) DEFAULT NULL,
`type` varchar(33) NOT NULL,
PRIMARY KEY (`id_boutique`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;
--
-- Contenu de la table `BOUTIQUE`
--
INSERT INTO `BOUTIQUE` (`id_boutique`, `nom_boutique`, `type`) VALUES
(12, 'boutique_1', 'INTERNE'),
(13, 'boutique_2', 'EXTERNE');
-- --------------------------------------------------------
--
-- Structure de la table `CATALOGUE`
--
CREATE TABLE IF NOT EXISTS `CATALOGUE` (
`url` varchar(255) DEFAULT NULL,
`prix` decimal(10,2) DEFAULT NULL,
`solde` decimal(11,2) DEFAULT NULL,
`ancien_prix` decimal(10,2) DEFAULT NULL,
`stock` varchar(25) DEFAULT NULL,
`ancien_stock` varchar(25) DEFAULT NULL,
`id_produit` int(11) NOT NULL,
`id_boutique` int(11) NOT NULL,
PRIMARY KEY (`id_produit`,`id_boutique`),
KEY `FK_catalogue_id_boutique` (`id_boutique`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Contenu de la table `CATALOGUE`
--
INSERT INTO `CATALOGUE` (`url`, `prix`, `solde`, `ancien_prix`, `stock`, `ancien_stock`, `id_produit`, `id_boutique`) VALUES
(NULL, 1.20, NULL, NULL, NULL, NULL, 3220, 12),
('url_du_produit_de_la_boutique_2.fr', 1.30, NULL, NULL, NULL, NULL, 3220, 13),
(NULL, 3.00, NULL, NULL, NULL, NULL, 3221, 12);
-- --------------------------------------------------------
--
-- Structure de la table `PRODUIT`
--
CREATE TABLE IF NOT EXISTS `PRODUIT` (
`id_produit` int(11) NOT NULL AUTO_INCREMENT,
`ref` varchar(25) DEFAULT NULL,
`nom_produit` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id_produit`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3222 ;
--
-- Contenu de la table `PRODUIT`
--
INSERT INTO `PRODUIT` (`id_produit`, `ref`, `nom_produit`) VALUES
(3220, 'ACBR-0003', 'Produit_1'),
(3221, 'ACBR-0002', 'Produit_2');
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `CATALOGUE`
--
ALTER TABLE `CATALOGUE`
ADD CONSTRAINT `FK_catalogue_id_boutique` FOREIGN KEY (`id_boutique`) REFERENCES `BOUTIQUE` (`id_boutique`),
ADD CONSTRAINT `FK_catalogue_id_produit` FOREIGN KEY (`id_produit`) REFERENCES `PRODUIT` (`id_produit`);
/*!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 */;[/sql]
dans ma table boutique je vais recupèrer toute les boutiques de concurrent dont la mienne, dans produit je vais mettre tout mes produit que je vends, dans catalogue je recupère url du concurrent et avec lie a un de mes produit j'insère ensuite leurs prix et leur stock dans ma partie affichage je souhaite faire quelque chose du style
[html]<table>
<thead>
<tr>
<th>Nom produit</th>
<th>Reference</th>
<th>Mon prix</th>
<th>Prix_concurent_1</th>
</tr>
</thead>
<tbody>
<tr>
<td>Produit_1</td>
<td>ACBR-0003</td>
<td>1.3€</td>
<td>1.4€</td>
</tr>
</tbody>
</table> [/html]
je vous met juste le html pour avoir l'idée de présentation si ça aide dans mon explication ;)