Datatables server-side processing - PHP / PostgreSQL - advanced queries
$30-250 USD
ชำระเงินเมื่อจัดส่ง
I´m trying to figure out how to group data from joined table in Datatables server-side PHP script.
The data for datatables in prepared by the PHP script using an SSP class modified for postgreSQL connection.
The table consists of products and their categories.
Everything is working well, but I cannot figure out how to prepare the SELECT statement in order to group product categories per product.
To make it easier to understand my problem you can see a setup example below.
PostgreSQL DB table structure:
Table: products_table
------------------------------------------
id | title | pr_template_id
------------------------------------------
1 | Product 1 | 1
2 | Product 2 | 2
3 | Product 3 | 3
------------------------------------------
Table: product_categories_template_relations
------------------------------------------
id | pr_template_id | category_id
------------------------------------------
1 | 1 | 1
2 | 1 | 2
3 | 2 | 2
4 | 2 | 3
5 | 3 | 1
------------------------------------------
Table: product_categories
------------------------------------------
category_id | title
------------------------------------------
1 | Category 1
2 | Category 2
3 | Category 3
------------------------------------------
Server side script (PHP):
<?php
$table = <<<EOT
(
SELECT
[login to view URL],
a.pr_template_id,
[login to view URL] as producttitle,
b.pr_template_id,
b.category_id,
[login to view URL] as cattitle
FROM products_table a
LEFT JOIN product_categories_template_relations b ON a.pr_template_id = b.pr_template_id
LEFT JOIN product_categories c ON b.category_id = c.category_id
) temp
EOT;
?>
Current Datatables results:
------------------------------------------
Product ID | Product title | Category
------------------------------------------
1 | Product 1 | Category 1
1 | Product 1 | Category 2
2 | Product 2 | Category 2
2 | Product 2 | Category 3
3 | Product 3 | Category 1
------------------------------------------
Datatables results I´m looking for:
---------------------------------------------------------
Product ID | Product title | Category
---------------------------------------------------------
1 | Product 1 | Category 1, Category 2
2 | Product 2 | Category 2, Category 3
3 | Product 3 | Category 1
---------------------------------------------------------
So basically I´m currently stuck at Server side script (PHP) and how to formulate the SQL query correctly.
I only accept bids from developers with specific experience in advanced Datatables server-side scripting.
Please also see this description of the problem:
https://stackoverflow.com/questions/51042935/datatables-server-side-php-using-ssp-class-how-to-group-after-join
หมายเลขโปรเจค: #17247154
เกี่ยวกับโปรเจกต์
มอบให้กับ:
freelancer 16 คน กำลังเสนอราคาในงานนี้ โดยมีราคาเฉลี่ยอยู่ที่ $163
Datatables server-side processing - PHP / PostgreSQL - advanced queries Hello, I have read the details that you mentioned in your project description. I am willing to work with you on this project. I hope that we can เพิ่มเติม
Hello, I can help with you in your project Datatables server-side processing - PHP / PostgreSQL - advanced queries. I have more than 5 years of experience in Datatables, PHP, PostgreSQL. We have worked on several si เพิ่มเติม
Hi, I am server side expert. I have read your description i have understood what you want. Please get in touch so we can start your project. Thanks
Hi, I read your requirement and understood that you need some one good at PHP and Postgres SQL knowledge to write best queries on grouping. I am good at both the technologies, last week I developed and delivered an ap เพิ่มเติม
Hi, I have similar work experience in this work. i love to complete this task on given schedule. please share you requirement specification details.