Search the Community
Showing results for tags 'JOIN'.
-
Hallo ihr Lieben, ich versuche seit mittlerweile mehreren Tagen im SQL Manager (im Backend) eine Abfrage mit JOIN zu erstellen bekomme immer die Fehlermeldung "Falsche SQL-Abfrage". Alles was ich bisher im Netz recherchieren konnte, weisst darauf hin, dass es eigentlich kein Problem sein sollte. Ich bin mehr oder weniger Laie und kratze nur an der Oberfläche, also bitte verzeiht mir evtl. komische Rückfragen oder unzureichende Informationsgabe. tynw_ ist das Prefix meiner Tabellen. Abfragen auf einzelne Tabellen funktioniert wunderbar. Nur sobald ich versuche die Funktion JOIN zu nutzen kommt die Fehlermeldung. Habe ich irgendeinen Fehler in der Syntax? select tynw_orders.*, tynw_order_detail.* From tynw_orders left join tynw_order_detail ON tynw_orders.id_orders = tynw_order_detail.id_orders ORDER BY id_order DESC LIMIT 10 Ich arbeite mit PS 8.1.6 und einer MariaDB 10.6.15 vielen Dank schon mal im voraus für Eure Unterstützung.
-
Hi All, Greetings of the day. The module helps to integrate Database Management Tool Adminer in the back-office. This helps to run SQL queries, and database backups, and perform various jobs such as SELECT/INSERT/UPDATE/DELETE database tables and columns in tables. Also, get information and search data in different tables and databases. It is a fully functional database administration panel available in many databases. It works with very huge/big database sizes in GB for example 4 GB database. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement. Features Create, drop and alter tables Delete, edit and add fields as well as manage keys on fields Execute any SQL statement Query your databases Manage privileges Export data into various formats Back up and restore your databases Connect to a database server with a username and password Select an existing database or create a new one List fields, indexes, foreign keys and triggers of table Change name, engine, collation, auto_increment, and comment of table Alter name, type, collation, comment and default values of columns Add and drop tables and columns Create, alter, drop and search by indexes including full-text Create, alter, drop and link lists by foreign keys Create, alter, drop and select from views Create, alter, drop and call stored procedures and functions Create, alter and drop triggers List data in tables with search, aggregate, sort and limit results Insert new records, update and delete the existing ones Supports all data types, and blobs through file transfer Execute any SQL command from a text field or a file Export table structure, data, views, routines, and databases to SQL or CSV Print database schema connected by foreign keys Show processes and kill them Display users and rights and change them Display variables with links to documentation Manage events and table partitions (MySQL 5.1) Schemas, sequences, user types (PostgreSQL) Easy to install and use. Nice graphical user interface to perform various database operations on multiple databases. Security using login and password screen. Cross-platform works on all Windows and Linux distributions. Help you interact with your MySQL database easily and effortlessly. Web-Based which means you can access from any computer Local resources aren't used when connecting Simplicity. Compatible with PrestaShop 1.6.x,1.7.x,8.x.x Benefits to Merchants It has a user friendly and intuitive user interface with a little learning curve, meaning that people can use and get used to the functions easily and quickly. It allows users to perform most of the MySQL functions, including managing databases, running MySQL queries, executing SQL statements, managing users and permissions, and many more. It can import data and export data from and to different formats. It is able to alter the stored data into any other formats with the help of predefined functions. Installation Step 1: Upload the module zip file from the back-office Module & Services menu tab. Module Manager area using the upload button. After the successful installation module menu, the link will appear in the left menu or top menu in the back-office more area. Step 2: Install the module using the install button. Step 3: Visit the module management page from the back-office "More" area (section) in the left menu in the back-office. Step 4: The module installation process is very easy, how module configuration works can be seen in a demo instance. Step 5: Please visit our demo instance for module configuration and usage demo. Step 6: Please watch our demo video on our YouTube Channel for module configuration and usage demo. - Module works without making any change in the existing PrestaShop file so that existing customization and theme change do not affect. - We provide free technical and feature support in installation, and configuration, as well as access to updates available for this product. - Free support on installation, configuration, and customization as per store requirements, for example, new hook addition on your store. Other : Please leave your valuable feedback after using the module on this post. This will help to increase self-confidence, improve service, and enhance the module as per requirements to make it better for different online stores. Our Website URL => https://www.presta-addons-modules.com/en/ Pay any amount as per your choice to get the multi-languages,multi-shops, and multi-shop-groups feature in the free addon Download Module and Documentation File. readme_en.pdf sfkdbmanage.zip
-
Hi, I would like to display a column with the product tags in admin (in product listing) : (On the screenshot, i’ve translated the column name "tag" by "artists" but it is the tag datas) I’ve created an override of AdminProductsController.php Then, I’ve extended the query in order to display tags in a column. $this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'product_tag` AS p_tag ON (p_tag.`id_product` = a.`id_product`) '; Now, i can display the tag id in a column. How can i have now the tag name (column name of tag table) I don’t know how to make this double join in pretsashop ?
-
Hi, i have to make a query with gives me this structure. P=Array ( [0] => Array ( [id__dic] => 79 [id__shop] => 1 [id__lang] => 2 [symbol] => uoi [parent_symbol] => Mich [root_symbol] => 0 [folder] => 1 [oorder] => 2 [active] => 1 [prefix] => dfield [name] => array( [1] => arrw [2] => arw ) [description] => array( [1] => arrw [2] => arw ) ) ) I created two queries like in bottom code, but i thing there is a better solution. Could you help me and give some suggestion? ..... $sql = " SELECT dic.*, ldic.* FROM "._DB_PREFIX_."dp__shop dic LEFT JOIN "._DB_PREFIX_."dp__lang ldic ON (dic.id_dp = ldic.id_dp AND dic.id__shop = ldic.id__shop) WHERE dic.id_dp__shop = '".$id_shop."' AND dic.symbol = '".$parent_s."' AND ldic.id_dp__lang = '".$id_lang."' ORDER BY dic.oorder ASC, dic.id_dp ASC "; $dic_BySymbol = Db::getInstance()->executeS($sql); $sqls = "SELECT name, description"; $sqls .= "FROM "._DB_PREFIX_."dp__lang"; $sqls .= "WHERE id_dp__shop = '".$id_shop."'"; $sqls .= "AND id_dp = '".$dic_BySymbol['0']['id__dic']."'"; $dic_BySymbolSubqueryLang = Db::getInstance()->executeS($sqls); $dic_BySymbol['name'] = array(); $dic_BySymbol['description'] = array(); foreach ($languages as $language) { $dic_BySymbol['name'][$language['id_lang']] = $dic_BySymbolSubqueryLang->name[$language['id_lang']]; $dic_BySymbol['description'][$language['id_lang']] = $dic_BySymbolSubqueryLang->description[$language['id_lang']]; } return $dic_BySymbol; }
-
Hello! I'm trying to create a query using DbQuery() and it seems that this class automatically sets the table prefix 'ps_' or whichever you have so you don't have to set it. For example: $query = new DbQuery(); $query->select(' whatever '); $query->from('product', 'p'); $query->innerJoin('product_lang', 'pl', 'pl.id_product = p.id_product'); $query->innerJoin('category_product', 'cp', 'cp.id_product = p.id_product'); As you can see, you don't need to write $query->from('ps_product', 'p'); It knows already the prefix to the tables. My problem is that I am trying to make a Left Join to a table I created with a different prefix, or not using the preset prefix at all. Having done that maybe a mistake, I don't know, but usually, the tables I create in my Prestashop database, have a different prefix to indicate to myself those are my tables. I know that there is something like '$addprefix = false' for DbQuery() but I can't find the documentation about it and where to set that false, and how to write the code about the table then. I am sure this has an easy solution. I have tried something like this: $query->leftJoin('frik_location', 'fl', 'fl.id_product = p.id_product AND fl.id_product_attribute = IFNULL(pa.id_product_attribute, 0)' , false); With that false at the end, but it does not work. So my table is called fik_location instead of ps_location (if i were to use the default prefix), anyone could help me with this? Thanks a lot in advance!
-
I've want to add my cms page counter to every CMS page. I followed this topic . every thing is OK for implementaion of that tutorial but I've had a problem: my query is: SELECT pv.counter AS total FROM ps_page_viewed pv LEFT JOIN ps_page p ON pv.id_page = p.id_page LEFT JOIN ps_page_type pt ON p.id_page_type = pt.id_page_type WHERE pt.name = 'cms' AND p.id_object = '194' in query we need join PS_PAGE_VIEWED and PS_PAGE tables. for every CMS page that I created in PS_PAGE table , the id_page set to 17(for every page!!- i have about 200 pages) and also in PS_PAGE_VIEWED for all cms page the Id_page is set to 17 ,too. also, if i create a new cms page, then in the both table , id_page automatically set 17.[in the PS_PAGE when i add a new product , the related page id will be add to table by new id and every thing about product is OK but for CMS page all page ID set to 17] e.g: new cms page : cmd_id=194 id in PS_Page: 17 ID in PS_Page_viewed: 17 new cms page : cmd_id=195 id in PS_Page: 17 ID in PS_Page_viewed: 17 new cms page : cmd_id=196 id in PS_Page: 17 ID in PS_Page_viewed: 17 my prestashop is 1.6.0.14 what should I do??? please help me thanks
-
Hi, I am creating a custom sales package module. When a custom joins a package he get discount if specific number of customer are reached for the product in that sales package. In the product page when i create on custom button "JOIN", i need to check whether i am logged in the site or not...if not i need to redirect the user to login and again bring back the customer to that specific product. Also when i click on the join button i want to call a function that set the cookie that customer has joined the package with checking of authentication. But i dont want to modify the default prestashop code for it. So when i click on JOIN button how can i call a function that asks me to check for redirection. Please i am still a learner in prestashop and not knowing much of it. Thanks.
-
Hi, I want to get additional data to product-list.tpl, but this data is in another table (table structure is product_id, data). I need to join this table to product list sql, but I dont know where to find it. Tried to join this table in Category.php / getProducts(), but still I can't get this new data. So my main question is where to join this new table to be able to get new data in product-list.tpl?
-
Combine Categories? Bulk upload created multiple Categories but they should be one! For example it created cat for outwear and coats but all products in coats so I want to make them one cat called coats. And i have several one I need to do this for. The upload create sub categories or sizes so i need to combine those as well. PLEASE HELP...im lost! You can see on my home page menu the drop downs that im talking about . http://buynowwholesale.com/index.php
- 1 reply
-
- categories
- Combine
-
(and 1 more)
Tagged with:
-
Hi guys, I was hoping someone could help me with my problem: I am creating a module for prestashop and have created the admin back office tab so that I can add things to the module's database table. One of the table attributes is actually a foreign key from another table and I would like to display more meaningful information rather than the foreign key in the admin grid. What would be the best way of doing this? Thanks to anyone who replies