binAuchHier
Grünschnabel
Hallo,
Quelle eine alte XTC - Datenbank. Über INNER JOIN konnte ich die Kundendaten in den Tabellen 'address_book' und 'customers' auslesen. Als nächstes stehen die Artikeldaten und die Kategorien an. Ein erster Test mehrere Tabellen mit Produktinfos über INNER JOIN auszugeben ging daneben. Kann mal einer von den Profis drüberschauen, wo der Fehler liegt?
Schonmal Danke
Quelle eine alte XTC - Datenbank. Über INNER JOIN konnte ich die Kundendaten in den Tabellen 'address_book' und 'customers' auslesen. Als nächstes stehen die Artikeldaten und die Kategorien an. Ein erster Test mehrere Tabellen mit Produktinfos über INNER JOIN auszugeben ging daneben. Kann mal einer von den Profis drüberschauen, wo der Fehler liegt?
Schonmal Danke
PHP:
$read_qry = mysql_query ("SELECT *
FROM products
INNER JOIN products_attributes
ON products.products_id = products_attributes.products_id
INNER JOIN products_content
ON products.products_id = products_content.products_id
INNER JOIN products_description
ON products.products_id = products_description.products_id");
echo "<table border=1>";
echo "<tr>\n";
echo "<th>[products] products_id</th>\n";
echo "<th>[products] products_image</th>\n";
echo "<th>[products] products_price</th>\n";
echo "<th>[products_attributes] products_attributes_id</th>\n";
echo "<th>[products_attributes] attributes_stock</th>\n";
echo "<th>[products_attributes] price_prefix</th>\n";
echo "<th>[products_description] products_name</th>\n";
echo "<th>[products_description] products_description</th>\n";
echo "<th>[products_description] products_keywords</th>\n";
echo "</tr>\n";
while ($zeile = mysql_fetch_array( $read_qry))
{
echo "<tr>";
echo "<td>". $zeile['products_id'] . "</td>";
echo "<td>". $zeile['products_image'] . "</td>";
echo "<td>". $zeile['products_price'] . "</td>";
echo "<td>". $zeile['products_attributes_id'] . "</td>";
echo "<td>". $zeile['attributes_stock'] . "</td>";
echo "<td>". $zeile['price_prefix'] . "</td>";
echo "<td>". $zeile['products_name'] . "</td>";
echo "<td>". $zeile['products_description'] . "</td>";
echo "<td>". $zeile['products_keywords'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close();