phpmyadmin php sql-script

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • phpmyadmin php sql-script

    Hallo zusammen

    Ich habe heute folgendes SQL Statement geschrieben, dieses funktioniert wunderbar, wenn ich es im PHPMYADMIN ausführe.

    Wenn ich jedoch diesen SQL-Code in PHP umwandle, dann weiss ich nicht mehr wie ich dies in PHP einfügen muss.

    MYSQL Abfrage in phpmyadmin:

    SELECT orders.customers_id,customers.customers_id,orders.orders_id,orders_products.products_id,products.pro ducts_id,manufacturers.manufacturers_id FROM orders
    inner join customers on customers.customers_id=orders.customers_id
    inner join orders_products on orders_products.orders_id=orders.orders_id
    inner join products on products.products_id=orders_products.products_id
    inner join manufacturers on manufacturers.manufacturers_id=products.manufacturers_id
    where orders.date_purchased=CAST('2005-12-28' AS DATETIME)

    in PHP umgewandelt durch phpmyadmin:

    $sql = 'SELECT orders.customers_id,customers.customers_id,orders.orders_id,orders_products.products_id,products.pro ducts_id,manufacturers.manufacturers_id FROM orders '
    . ' inner join customers on customers.customers_id=orders.customers_id'
    . ' inner join orders_products on orders_products.orders_id=orders.orders_id'
    . ' inner join products on products.products_id=orders_products.products_id'
    . ' inner join manufacturers on manufacturers.manufacturers_id=products.manufacturers_id'
    . ' where orders.date_purchased=CAST(''2005-11-15'' AS DATETIME) LIMIT 0, 30';

    Hat jemand eine Ahnung wie ich die jetzt integrieren muss, inkl. DB-Verbindung, damit ich die Wert ausgeben kann?

    Vielen Dank

    Gruss
    Schampar

  • #2
    lies Dich ein in die Grundlagen von MySQL und PHP
    Beantworte nie Threads mit mehr als 15 followups...
    Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

    Kommentar

    Lädt...
    X