Ich habe etwas entsprechendes für osCommerce gefunden welches eigentlich auch bei xt laufen müsste. Allerdings erhalte ich eine Fehlermeldung:
Temporary query failure: Unknown column 'address_book.entry_country_id' in 'on clause'
Hier der Code:
PHP-Code:
$query = "SELECT DISTINCT COUNT(*) as count, address_book.entry_country_id, countries.countries_name FROM address_book, customers JOIN countries ON address_book.entry_country_id = countries.countries_id WHERE customers.customers_id = address_book.customers_id AND customers.customers_default_address_id = address_book.address_book_id GROUP BY entry_country_id ORDER BY countries.countries_name";
$result = mysql_query($query) or die("Temporary query failure: " . mysql_error());
echo " <table>\n";
echo " <tr class=\"header\"><th>country</th><th>customers</th></tr>\n";
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo " <tr>\n";
echo " <td><a href=\"cities.php?country_id=$row[1]\">$row[2]</a></td>\n";
echo " <td align=\"center\">$row[0]</td>\n";
echo " </tr>\n";
}
echo " </table>\n";
mysql_free_result($result);
Kann mir jemand helfen?