• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

JOIN Abfrage

Yosh™

Mitglied
Hallo,

ich möchte eine Abfrage gestalten welche über mehrere Tabellen geht.

PHP:
$stmt = $pdo->prepare('SELECT * FROM     shop_products a
                                JOIN        shop_products_color b
                                ON             a.id_products = b.id_products_color
                                JOIN        shop_products_images c
                                ON            a.id_products = c.id_products_images
                                JOIN        shop_products_information as d
                                ON            a.id_products = d.id_product
                                JOIN        backend_product_information e
                                ON            d.id_information = e.id_product_information
                               
                               
                                WHERE a.product_hash=?;');
    $stmt->execute(
        array(
            $_GET['pKey']
        )
    );

So. Allerdings ist bei ON das Problem, sobald in einer der Angegebenen Tabellen nichts gefunden wird, so gibt er mir garnix mehr aus.

Wie kann ich eine Abfrage gestalten, welche über mehrere Tabellen geht, allerdings auch wenn er in einer Tabelle nichts findet, den Rest trotzdem ausgibt?
 
Zurück
Oben