Jump to content

Search the Community

Showing results for tags 'daten sortieren'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News and Announcements
    • News and Announcements
  • osCommerce Online Merchant v2.x
    • General Support
    • osCommerce Online Merchant Community Bootstrap Edition
    • Add-Ons
  • Development
  • General
    • General Discussions
    • Live Shop Reviews
    • Security
    • Developer Feedback
  • PayPal's Announcements
  • Sage Pay's Announcements
  • Solomono - new level osCommerce templates's Announcements
  • German Community's OSCOM v2.x
  • German Community's Allgemein

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Real Name


Location


Interests


Website

Found 1 result

  1. Torsten_OL

    Daten sortieren

    osCommerce Online Merchant v2.3.4 Hallo zusammen. Ich (Torsten der Laie) benötige mal wieder etwas Hilfe. Die osCommerce Daten möchte ich in eine Excel-Datei exportieren. Das klappt auch soweit ganz gut - sicherlich gibt es elegantere Lösungen. Nun möchte ich die Daten sortiert ausgeben 1. sortiert nach: categories_id 2. nach: products_name Aber ich weiß nicht wo und wie ich "order by" einbinden muss. Danke für die Hilfe Anbei der Code meiner Datei. <!-- p.products_id, p.products_model, p.products_gesundheit, p.products_gesundheit2 p.products_hoehe, p.products_quantity, p.products_duftst, p.products_weight, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id pd.products_name, pd.products_registered, pd.products_description, pd.products_bluehsorte, pd.products_bluetenfarbe, pd.products_bluetezeit, pd.products_url, --> <?php require('includes/application_top.php'); require('includes/configure.php'); require('includes/database_tables.php'); require(DIR_WS_INCLUDES . 'template_2_top.php'); $myfile = fopen("excel_daten_file.xls", "w") or die("Unable to open file!"); error_reporting(E_ALL); $db_link = mysqli_connect (DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE); if ( $db_link ) { $TEXT_DATEN_EXPORT_VERBINDUNG ="Verbindung erfolgreich"; // print_r( $db_link); } else { $TEXT_DATEN_EXPORT_VERBINDUNG =("keine Verbindung möglich" . mysqli_error()); } $sql_products = "SELECT * FROM products "; $db_products = mysqli_query( $db_link, $sql_products ); $sql_products_description = "SELECT * FROM products_description "; $db_products_description = mysqli_query( $db_link, $sql_products_description ); if ( ! $db_products ) { $TEXT_DATEN_EXPORT_VERBINDUNG =("Ungültige Abfrage" . mysqli_error()); } ?> <td><table border="0" cellspacing="2" cellpadding="2"> <tr><td class="main"><?php echo $TEXT_DATEN_EXPORT_VERBINDUNG; ?> </td> <td class="pageHeading" align="right"><a href="excel_daten_file.xls" download="excel_daten_file.xls"><?php echo tep_draw_button("Excel-Datei speichern" , 'calculator'); ?></a></td> </tr> </table></td> <?php echo '<table border="1">'; echo "<tr>"; echo "<td>". "pID" . "</td>"; echo "<td>". "mID" . "</td>"; echo "<td>". "Z&uuml;chter" . "</td>"; echo "<td>". "cID" . "</td>"; echo "<td>". "Sortiment" . "</td>"; echo "<td>". "ID" . "</td>"; echo "<td>". "Liter" . "</td>"; echo "<td>". "Name_EN" . "</td>"; echo "<td>". "Name_DE" . "</td>"; echo "<td>". "image" . "</td>"; echo "<td>". "Beschreibnug_EN" . "</td>"; echo "<td>". "Beschreibung_DE" . "</td>"; echo "<td>". "H&ouml;he" . "</td>"; echo "<td>". "Farbe_EN" . "</td>"; echo "<td>". "Farbe_DE" . "</td>"; echo "<td>". "telefon" . "</td>"; echo "</tr>"; while ($zeile = mysqli_fetch_array( $db_products, MYSQL_ASSOC)) { $zeile_eng = mysqli_fetch_array( $db_products_description, MYSQL_ASSOC); $zeile_deu = mysqli_fetch_array( $db_products_description, MYSQL_ASSOC); $num = $zeile['manufacturers_id']; $sql_manufacturers = "SELECT * FROM manufacturers WHERE manufacturers_id LIKE '$num' "; $db_manufacturers = mysqli_query( $db_link, $sql_manufacturers ); $zeile_man = mysqli_fetch_array( $db_manufacturers, MYSQL_ASSOC); $num = $zeile['products_id']; $sql_products_to_categories = "SELECT * FROM products_to_categories WHERE products_id LIKE '$num' "; $db_products_to_categories = mysqli_query( $db_link, $sql_products_to_categories ); $zeile_cat = mysqli_fetch_array( $db_products_to_categories, MYSQL_ASSOC); $num = $zeile_cat['categories_id']; $sql_categories_description = "SELECT * FROM categories_description WHERE categories_id LIKE '$num' "; $db_categories_description = mysqli_query( $db_link, $sql_categories_description ); $zeile_cat_desc = mysqli_fetch_array( $db_categories_description, MYSQL_ASSOC); // Bildschirmausgabe echo "<tr>"; echo "<td>". $zeile['products_id'] . "</td>"; echo "<td>". $zeile['manufacturers_id'] . "</td>"; echo "<td>". $zeile_man['manufacturers_name'] . "</td>"; echo "<td>". $zeile_cat['categories_id'] . "</td>"; echo "<td>". $zeile_cat_desc['categories_name'] . "</td>"; echo "<td>". $zeile['products_model'] . "</td>"; echo "<td>". $zeile['products_weight'] . "</td>"; echo "<td>". $zeile_eng['products_name'] . "</td>"; echo "<td>". $zeile_deu['products_name'] . "</td>"; echo "<td>". $zeile['products_image'] . "</td>"; echo "<td>". $zeile_eng['products_description'] . "</td>"; echo "<td>". $zeile_deu['products_description'] . "</td>"; echo "<td>". $zeile['products_hoehe'] . "</td>"; echo "<td>". $zeile_eng['products_bluetenfarbe'] . "</td>"; echo "<td>". $zeile_deu['products_bluetenfarbe'] . "</td>"; echo "<td>". $zeile['telefon'] . "</td>"; echo "</tr>"; // Exceldaten zusammen stellen - leider noch unsortiert $xls = $zeile_cat['categories_id'] . "\t". $zeile_deu['products_name']. "\t". $zeile_cat_desc['categories_name']. "\t". $zeile_man['manufacturers_name'] ."\n" ; // Exceldaten in Datei schreiben fwrite($myfile, $xls); } fclose($myfile); echo "</table>"; mysqli_free_result( $db_products ); ?> <a href="excel_daten_file.xls" download="excel_daten_file.xls"><?php echo tep_draw_button("Excel-Datei speichern" , 'calculator'); ?></a> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
×