Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[réglé]récuperer la quantite ...

Featured Replies

Posté(e)

Bonjour a tous

Voila le topo:

je veu recuperer la quantite commandé de chaque produit commandé exemple:

Id Quantité

4 2

5 1

9 1

10 1

8 2

7 1

2 1

6 1

2 2

4 1

10 2

le resultat que je desire avoir:

Id Quantité

4 3

5 1

9 1

10 3

8 2

7 1

2 3

6 1

ces resultats me serverons a avoir les données necessaire pour la creation de statistique notament un camember

voici le code que jai utilisé avec le resultat:

<?php
session_start();
//ici la cnx à la base 
require('login_bdd.php'); 
$identificateur=mysql_connect($host,$user,$pass);
mysql_select_db($base,$identificateur);

$tab1=mysql_query("SELECT idProduit, quantite FROM paniers");

echo("Id    Quantité <br>");
while($liste_produit=mysql_fetch_array($tab1))
			{
			echo($liste_produit[0]."          ".$liste_produit[1]." <br> ");
			}


//On parcourt le tableau
foreach($liste_produit as $nom => $valeur)
			 {
			$nb[$valeur]++;
			echo($nb[0]."<br>");
			}


?>

resultat :

Id Quantité

4 2

5 1

9 1

10 1

8 2

7 1

2 1

6 1

2 2

4 1

10 2

Warning: Invalid argument supplied for foreach() in c:\program files\easyphp1-8\www\test.php on line 18

merci

Modifié par amine84

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.