If that's true, please note that this tool is not an ultimate query generator. It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.
Included support for the plugin doesn't include writing custom queries, and only refers to advice.
I have a listings of of different listing type. I am creating a table of the these listings (with link) with a particular type of listing. will it not work even such a simple query?
SELECT posts_job_listing.post_title AS job_listing_post_title, CONCAT('<a href="',posts_job_listing.guid,'">',posts_job_listing.post_title,'</a>') AS job_listing_title_with_link_to_post, posts_case27_listing_type.post_title AS case27_listing_type_post_title FROM wp_posts AS posts_job_listing, wp_posts AS posts_case27_listing_type WHERE 1=1 AND posts_job_listing.post_type = 'job_listing' AND posts_case27_listing_type.post_title = 'Assembly Constituency' AND posts_case27_listing_type.post_type = 'case27_listing_type'
The PHP SQL parser we use can experience issues with CONCAT, UNION, JOIN and subqueries, so can you please create a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
Please note some of this when working with the server-side processing feature:
Please do not use “LIMIT” in the SELECT statement. wpDataTables adds it automatically and it will be overridden.
Please do not use “ORDER BY” in the SELECT statement. wpDataTables has its own sorting engine so it makes no sense to use MySQL’s sorting since it will be overridden. Also, the server-side processing feature adds this part of the statement automatically when users trigger the sorting on the front-end, and having it in the initial statement may cause the table to crash.
Creating a MySQL view is not a part of wpDataTables, but SQL knowledge, so there are no documents on how you can use it.
The hyperlink provided in my previous response should help you out with this, but in the end it's quite simple.
Go to your database, and click on SQL. In there, paste this query:
CREATE VIEW view1 AS SELECT posts_job_listing.post_title AS job_listing_post_title,
CONCAT('<a href="',posts_job_listing.guid,'">',posts_job_listing.post_title,'</a>') AS job_listing_title_with_link_to_post,
posts_case27_listing_type.post_title AS case27_listing_type_post_title
FROM wp_posts AS posts_job_listing, wp_posts AS posts_case27_listing_type
WHERE 1=1
AND posts_job_listing.post_type = 'job_listing'
AND posts_case27_listing_type.post_title = 'Assembly Constituency'
AND posts_case27_listing_type.post_type = 'case27_listing_type'
That should create a view (if the query is good), and you will be able to create a new table in wpDataTables with:
Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party.
You can write credentials here just check Private Reply so nobody can see them except us.
This placeholder %listing-type% needs to be replaced with the correct value, but it can't be done through wpDataTables.
You would need to find where the listing type is located (in which database table, since it's not in wp_posts), and find a way to replace the placeholder for it, for the correct URL. It would probably require a complex query, and joining multiple database tables with some conditions.
I can take a look at your database as a last attempt to find a workaround for you, but I cannot guarantee anything. If you can provide me database access credentials, I'll take a look.
In "meta_value" column, these are saved as serialized values, like this for example:
[{"id":"363c7908","elType":"section","settings":[],"elements":[{"id":"29332111","elType":"column","settings":{"_column_size":100,"_inline_size":null,"background_background":"classic","background_color":"#FFFFFF","margin":{"unit":"%","top":"4","right":"0","bottom":"2","left":"0","isLinked":false}},"elements":[{"id":"7b04b0d9","elType":"widget","settings":{"title":"Explore Assembly Constituency by MLA","align":"center","title_color":"#54595F","typography_typography":"custom","_margin":{"unit":"px","top":"5","right":"0","bottom":"5","left":"0","isLinked":false}},"elements":[],"widgetType":"heading"}],"isInner":false}],"isInner":false},{"id":"e5ib7yy","elType":"section","settings":{"layout":"full_width","gap":"no","margin":{"unit":"px","top":"0","right":0,"bottom":"0","left":0,"isLinked":false},"margin_tablet":{"unit":"px","top":"","right":0,"bottom":"","left":0,"isLinked":true},"padding":{"unit":"px","top":"0","right":"0","bottom":"60","left":"0","isLinked":false},"padding_tablet":{"unit":"px","top":"0","right":"0","bottom":"40","left":"0","isLinked":false},"padding_mobile":{"unit":"px","top":"0","right":"0","bottom":"30","left":"0","isLinked":false}},"elements":[{"id":"no7ij0f","elType":"column","settings":{"_column_size":100},"elements":[{"id":"sea90f9","elType":"widget","settings":{"27_title":"What are you looking for?","27_subtitle":"Search or select categories","27_tabs":[{"27_tab_type":"listing_type","27_listing_type":"business","27_tab_label":"Categories","27_categories_to_show":"by_listing_type","27_category_listing":"","27_category_list":"","_id":"w5tyfak"},{"27_tab_type":"category_list","27_listing_type":"","27_tab_label":"Categories","27_categories_to_show":"by_listing_type","27_category_listing":"business","27_category_list":"","_id":"85t8bq7"}],"27_map_skin":"skin3","27_listing_types":[{"type":"assembly-constituency","_id":"eef9894"}],"27_categories":[{"category":"17","_id":"vsrf11j"},{"category":"18","_id":"44z82e9"},{"category":"19","_id":"kbuov9u"},{"category":"20","_id":"mip10el"},{"category":"21","_id":"ei2safw"},{"category":"22","_id":"nn8r40a"},{"category":"27","_id":"m9mhib7"}],"27_categories_overlay__gradient":"gradient1","27_template":"explore-classic","_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"27_finder_columns":"finder-two-columns"},"elements":[],"widgetType":"case27-explore-widget"}],"isInner":false}],"isInner":false}]
So, in there you have [{"type":"assembly-constituency","_id":"eef9894"}], which needs to be linked to the wp_posts table. But before it is linked, it needs to be unserialized. This requires a complex query I'm not able to help you with.
This really goes far beyond what support for the plugin includes.
It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in the near future.
But we can recommend these services for customization:
Hi,
I created table with link to post using by wordpress database but I am getting two issue
1.on clicking the link I am getting 400 bad request.
2.Number of post in the table are wrong ( I verified manually)
Please help me
Regards
Hasan
Hello Hasan
I suppose you created the table using our WP Database query constructor, right?
If that's true, please note that this tool is not an ultimate query generator. It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.
Included support for the plugin doesn't include writing custom queries, and only refers to advice.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi,
This is simple query no complication is involved.
I have a listings of of different listing type. I am creating a table of the these listings (with link) with a particular type of listing. will it not work even such a simple query?
Regards
Can you show me the query, Hasan?
It could be a small issue, if it's a simple query.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi,
Please find the query
SELECT posts_job_listing.post_title AS job_listing_post_title,
CONCAT('<a href="',posts_job_listing.guid,'">',posts_job_listing.post_title,'</a>') AS job_listing_title_with_link_to_post,
posts_case27_listing_type.post_title AS case27_listing_type_post_title
FROM wp_posts AS posts_job_listing, wp_posts AS posts_case27_listing_type
WHERE 1=1
AND posts_job_listing.post_type = 'job_listing'
AND posts_case27_listing_type.post_title = 'Assembly Constituency'
AND posts_case27_listing_type.post_type = 'case27_listing_type'
The PHP SQL parser we use can experience issues with CONCAT, UNION, JOIN and subqueries, so can you please create a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
Please note some of this when working with the server-side processing feature:
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
could you please share some document as this is not very clear for me
Creating a MySQL view is not a part of wpDataTables, but SQL knowledge, so there are no documents on how you can use it.
The hyperlink provided in my previous response should help you out with this, but in the end it's quite simple.
Go to your database, and click on SQL. In there, paste this query:
That should create a view (if the query is good), and you will be able to create a new table in wpDataTables with:
SELECT * FROM view1
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Still I have same issue (although table created without any error)
Hello again Hasan.
Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party.
You can write credentials here just check Private Reply so nobody can see them except us.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks, Hasan.
This placeholder %listing-type% needs to be replaced with the correct value, but it can't be done through wpDataTables.
You would need to find where the listing type is located (in which database table, since it's not in wp_posts), and find a way to replace the placeholder for it, for the correct URL. It would probably require a complex query, and joining multiple database tables with some conditions.
I can take a look at your database as a last attempt to find a workaround for you, but I cannot guarantee anything. If you can provide me database access credentials, I'll take a look.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
what is your IP
Thank you Hasan.
Unfortunately, I was not able to locate where %listing_type% is saved in the database, so I cannot help you with the query.
Can you reach out to MyListing, and ask them where this is saved, so we know where to look?
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
It is saved in Postmeta table.
%listing_type% is converted to the listing type e.g. if I have listing type as restaurant it will save as restaurant Not as listing_type.
Regards
Hasan
Thanks for that.
In "meta_value" column, these are saved as serialized values, like this for example:
[{"id":"363c7908","elType":"section","settings":[],"elements":[{"id":"29332111","elType":"column","settings":{"_column_size":100,"_inline_size":null,"background_background":"classic","background_color":"#FFFFFF","margin":{"unit":"%","top":"4","right":"0","bottom":"2","left":"0","isLinked":false}},"elements":[{"id":"7b04b0d9","elType":"widget","settings":{"title":"Explore Assembly Constituency by MLA","align":"center","title_color":"#54595F","typography_typography":"custom","_margin":{"unit":"px","top":"5","right":"0","bottom":"5","left":"0","isLinked":false}},"elements":[],"widgetType":"heading"}],"isInner":false}],"isInner":false},{"id":"e5ib7yy","elType":"section","settings":{"layout":"full_width","gap":"no","margin":{"unit":"px","top":"0","right":0,"bottom":"0","left":0,"isLinked":false},"margin_tablet":{"unit":"px","top":"","right":0,"bottom":"","left":0,"isLinked":true},"padding":{"unit":"px","top":"0","right":"0","bottom":"60","left":"0","isLinked":false},"padding_tablet":{"unit":"px","top":"0","right":"0","bottom":"40","left":"0","isLinked":false},"padding_mobile":{"unit":"px","top":"0","right":"0","bottom":"30","left":"0","isLinked":false}},"elements":[{"id":"no7ij0f","elType":"column","settings":{"_column_size":100},"elements":[{"id":"sea90f9","elType":"widget","settings":{"27_title":"What are you looking for?","27_subtitle":"Search or select categories","27_tabs":[{"27_tab_type":"listing_type","27_listing_type":"business","27_tab_label":"Categories","27_categories_to_show":"by_listing_type","27_category_listing":"","27_category_list":"","_id":"w5tyfak"},{"27_tab_type":"category_list","27_listing_type":"","27_tab_label":"Categories","27_categories_to_show":"by_listing_type","27_category_listing":"business","27_category_list":"","_id":"85t8bq7"}],"27_map_skin":"skin3","27_listing_types":[{"type":"assembly-constituency","_id":"eef9894"}],"27_categories":[{"category":"17","_id":"vsrf11j"},{"category":"18","_id":"44z82e9"},{"category":"19","_id":"kbuov9u"},{"category":"20","_id":"mip10el"},{"category":"21","_id":"ei2safw"},{"category":"22","_id":"nn8r40a"},{"category":"27","_id":"m9mhib7"}],"27_categories_overlay__gradient":"gradient1","27_template":"explore-classic","_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"27_finder_columns":"finder-two-columns"},"elements":[],"widgetType":"case27-explore-widget"}],"isInner":false}],"isInner":false}]
So, in there you have [{"type":"assembly-constituency","_id":"eef9894"}], which needs to be linked to the wp_posts table. But before it is linked, it needs to be unserialized. This requires a complex query I'm not able to help you with.
This really goes far beyond what support for the plugin includes.
It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in the near future.
But we can recommend these services for customization:
https://codeable.io/?ref=l1TW1
https://wpkraken.io/?tms-plugins
They do develop such solutions, so can you please send your inquiry to them?
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables