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
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
Kommentar