Hallo CB Community,
Ich versuche Bellungen aus der "orders" tabelle zu kopieren, dies klappt auch.
Nun will ich beim Export aber auch informationen aus der tabelle "magnalister_orders"
Also habe ich an ein inner join gedacht im SQL Statement, da scheints aber zu hängen:
Klappt (nur eine Tabelle) :
klappt mit sql join nicht (2 Tabellen):
hat jemand einen Denkanstoß?
mir wird immer folgendes angezeigt als Ausgabefehler:
Fatal error: Call to a member function fetch_array() on a non-object in /usr/www/users/wwwkmg/bestell_export/single_export.php on line 144
...Line 144 wäre eben:
while($row = $result->fetch_array())
Gruß
Harry2k
Ich versuche Bellungen aus der "orders" tabelle zu kopieren, dies klappt auch.
Nun will ich beim Export aber auch informationen aus der tabelle "magnalister_orders"
Also habe ich an ein inner join gedacht im SQL Statement, da scheints aber zu hängen:
Klappt (nur eine Tabelle) :
PHP:
$query = "SELECT * FROM orders WHERE orders_id = $singleorder ORDER BY date_purchased DESC";
$result = $db_con->query($query);
//Daten im CSV-Format aufbereiten
//$data =
$columns = array(
"orders_id",
"customers_id",
"customers_cid",
"customers_vat_id",
"customers_status",
"customers_status_name",
"customers_status_image",
"customers_status_image",
"customers_gender",
"customers_name",
"customers_firstname",
"customers_lastname",
"customers_company",
"customers_street_address",
"customers_suburb",
"customers_city",
"customers_postcode",
"customers_state",
"customers_country",
"customers_telephone",
"customers_mobile",
"customers_fax",
"customers_email_address",
"customers_address_format_id",
"delivery_name",
"delivery_firstname",
"delivery_lastname",
"delivery_company",
"delivery_street_address",
"delivery_suburb",
"delivery_city",
"delivery_postcode",
"delivery_state",
"delivery_country",
"delivery_country_iso_code_2",
"delivery_address_format_id",
"billing_name",
"billing_firstname",
"billing_lastname",
"billing_company",
"billing_street_address",
"billing_suburb",
"billing_city",
"billing_postcode",
"billing_state",
"billing_country",
"billing_country_iso_code_2",
"billing_address_format_id",
"payment_method",
"cc_type",
"cc_owner",
"cc_number",
"cc_expires",
"cc_start",
"cc_issue",
"cc_cvv",
"comments",
"last_modified",
"date_purchased",
"orders_status",
"orders_date_finished",
"currency",
"currency_value",
"account_type",
"payment_class",
"shipping_method",
"shipping_class",
"customers_ip",
"language",
"afterbuy_success",
"afterbuy_id",
"refferers_id",
"conversion_type",
"orders_ident_key",
"inm_billnr",
"ibn_billdate"
//"marketplace",
//"special"
);
$data='';
foreach($columns as $c){
$data.=$c.";";
}
$data = substr($data,0,strlen($data)-1)."\r\n";
unset($c);
while($row = $result->fetch_array())
klappt mit sql join nicht (2 Tabellen):
PHP:
$query = "SELECT orders.*,magnalister_orders.marketplace,magnalister_orders.special FROM orders,magnalister_orders INNER JOIN magnalister_orders ON (orders.orders_id = magnalister_orders.orders_id) WHERE orders.orders_id = $singleorder ORDER BY orders.date_purchased DESC";
hat jemand einen Denkanstoß?
mir wird immer folgendes angezeigt als Ausgabefehler:
Fatal error: Call to a member function fetch_array() on a non-object in /usr/www/users/wwwkmg/bestell_export/single_export.php on line 144
...Line 144 wäre eben:
while($row = $result->fetch_array())
Gruß
Harry2k