Récupération des donné, mais multiplié
Bonjour,
Voila ex : dans mon site j’ai 3 articles, j’essaye de les récupérer le problème au lieu qu’il m’affiche les 3 articles le script les multiplis par 8.
Voila mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| <?php
$server ="localhost";
$user ="root";
$pass ="******";
$db ="mydb1";
mysql_connect($server, $user, $pass) or die('Erreur de connexion');
mysql_select_db($db) or die('Base inexistante');
$sql = "SELECT * FROM ps_orders,ps_order_history , ps_customer,ps_address,ps_order_detail WHERE ps_orders.id_order = ps_order_history.id_order";
$req = mysql_query($sql) or die('Erreur SQL !'.$sql.''.mysql_error());
echo '<b>debut</b>; ';
echo '<table border="1">';
echo '<tr>';
while($data = mysql_fetch_assoc($req))
{
echo '<td>';
echo '<!-- 1order_history -->';
echo ''.$data['payment'].'; ';
echo ''.$data['total_paid'].'; ';
echo ''.$data['id_order'].'; ';
echo ''.$data['id_carrier'].'; ';
echo ''.$data['id_lang'].'; ';
echo ''.$data['id_customer'].'; ';
echo ''.$data['id_cart'].'; ';
echo ''.$data['id_currency'].'; ';
echo ''.$data['id_address_delivery'].'; ';
echo ''.$data['id_address_invoice'].'; ';
echo ''.$data['recyclable'].'; ';
echo ''.$data['gift_message'].'; ';
echo ''.$data['date_add'].' ; ';
echo ''.$data['id_order_state'].'; ';
echo '<!-- 2order_history --><br><br>';
echo '<!-- 1customer -->';
echo ''.$data['email'].'; ';
echo ''.$data['lastname'].'; ';
echo ''.$data['firstname'].'; ';
echo '<!-- 2customer --><br><br>';
echo '<!-- 1address-->';
echo ''.$data['company'].'; ';
echo ''.$data['address1'].'; ';
echo ''.$data['postcode'].'; ';
echo ''.$data['city'].'; ';
echo ''.$data['address2'].'; ';
echo ''.$data['other'].'; ';
echo ''.$data['phone'].'; ';
echo ''.$data['phone_mobile'].'; ';
echo '<!-- 2address--><br><br>';
echo '<!-- 1product_id --> ';
echo ''.$data['product_id'].'; ';
echo ''.$data['product_name'].'; ';
echo ''.$data['product_quantity'].'; ';
echo ''.$data['product_price'].'; ';
echo ''.$data['product_reference'].'; ';
echo '<!-- 2product_id --> <br><br>';
echo '</td>';
}
echo '</tr><tr>';
echo '</table>';
echo '<b>fin</b>; ';
mysql_close();
?> |
Merci d’avance