Zurück   xt:Commerce Webshop Shop Support > xt:Commerce Shopsoftware Community Area > Shopbereich

Antwort
 
LinkBack Themen-Optionen Ansicht
  #1 (permalink)  
Alt 30.03.2008, 17:44
Benutzer
 
Registriert seit: 07.09.2006
Beiträge: 78
Standard MySQL Fehler bei Abfrage nach Bestellungen pro Land

Ich würde gern eine Karte anzeigen lassen in welchem Land bzw. Kontinent wieviele Bestellungen von einem bestimmten Produkt es gibt. Folgendes Script zeigt mir leider alle Bestellungen von den entsprechenden Ländern an, nicht diese die zu dem Produkt (0001) gehören. Also irgendwie scheint die "WHERE" Abfrage falsch zu sein? Kann mir jemand helfen?

PHP-Code:
 $query "SELECT 
DISTINCT COUNT(*) as count, orders.orders_id, orders.customers_country, countries.countries_name, orders_products.products_model
      
  FROM orders

JOIN
      orders_products ON orders.orders_id = orders_products.orders_id
JOIN
      countries ON orders.customers_country = countries.countries_name
WHERE 
      countries.countries_name='Andorra' OR countries.countries_name='Austria' OR countries.countries_name='Belgium' OR countries.countries_name='Bosnia and Herzegowina' OR countries.countries_name='Bulgaria' OR countries.countries_name='Denmark' OR countries.countries_name='Germany' OR countries.countries_name='Estonia' OR countries.countries_name='Faroe Islands' OR countries.countries_name='Finland' OR countries.countries_name='France' OR countries.countries_name='Gibraltar' OR countries.countries_name='Greenland' OR countries.countries_name='Greece' OR countries.countries_name='United Kingdom' OR countries.countries_name='Ireland' OR countries.countries_name='Iceland' OR countries.countries_name='Italy' OR countries.countries_name='Croatia' OR countries.countries_name='Latvia' OR countries.countries_name='Liechtenstein' OR countries.countries_name='Lithuania' OR countries.countries_name='Luxembourg' OR countries.countries_name='Malta' OR countries.countries_name='Macedonia' OR countries.countries_name='Moldova' OR countries.countries_name='Monaco' OR countries.countries_name='Netherlands' OR countries.countries_name='Norway' OR countries.countries_name='Poland' OR countries.countries_name='Portugal' OR countries.countries_name='Romania' OR countries.countries_name='San Marino' OR countries.countries_name='Sweden' OR countries.countries_name='Switzerland' OR countries.countries_name='Slovakia' OR countries.countries_name='Slovenia' OR countries.countries_name='Spain' OR countries.countries_name='Turkey' OR countries.countries_name='Czech Republic' OR countries.countries_name='Ukraine' OR countries.countries_name='Hungary' OR countries.countries_name='Cyprus'
     
     AND orders_products.products_model ='0001'
      
GROUP BY 
      countries.countries_name"
;
      
  
$result mysql_query($query) or die("Temporary query failure: " mysql_error());
  
  echo 
"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td width=\"25%\"><img src=\"/images/map_europe.gif\" width=\"246\" height=\"185\" /></td>
    <td width=\"75%\">"
;
 
  echo 
"    <table>\n";
  while (
$row mysql_fetch_array($resultMYSQL_NUM)) {
    echo 
"      <tr>\n";
    echo 
"        <td>$row[2]</td>\n";
    echo 
"        <td align=\"center\">$row[0]</td>\n";
    echo 
"      </tr>\n";
  }
  echo 
"    </table>\n";
   echo 
" </td>
  </tr>
</table>\n"
;
 
  
mysql_free_result($result); 
Danke!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
abfrage, bestellungen, fehler, land, mysql, pro

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Fehler Bei Bestellungen pkaruna Installation und Konfiguration 1 27.03.2005 10:50


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:03 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand