I want to give a serial number in the datatable that is returned through the mysql query. However, when I try to the following query, it gives me an error that SET is not implemented. Please help.
SET @row_number = 0;
SELECT (@row_number:=@row_number + 1) AS num, firstName, lastName
FROM employees
LIMIT 5;
As indicated in our documentation, you cannot use variables ( @ ), stored procedures and nested queries in the plugin, but you can prepare a MySQL view (which will return the data you need); call it “view1” for example, and then build a wpDataTable based on a simple query like “SELECT * FROM view1”.
I want to give a serial number in the datatable that is returned through the mysql query. However, when I try to the following query, it gives me an error that SET is not implemented. Please help.
Hello Vivek
Thank you for your purchase.
As indicated in our documentation, you cannot use variables ( @ ), stored procedures and nested queries in the plugin, but you can prepare a MySQL view (which will return the data you need); call it “view1” for example, and then build a wpDataTable based on a simple query like “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