I created a simple table with SQL query on the default WP database
Basic SELECT COUNT, CONCATENATE, LEFT JOIN, GROUP BY
This worked perfectly.
After that I tried to add a field to my SQL query I got an error from the plugin. Something like "cannot be null" in a red square box. Then the page is blank and I lost everything
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.
Also, please tell me what's the table ID, so I know where to look.
OK I checked in the database and there was a space character that create the error. Query was:
SELECT COUNT (r.slot_id), COUNT(s.slot_id), CONCAT(DAYNAME(s.slot_date), " ", HOUR(s.slot_time_from)) as slot FROM wordpress_eaown5g98booking_slots AS s LEFT JOIN wordpress_eaown5g98booking_reservation AS r ON r.slot_id = s.slot_id GROUP BY slot
Notice the space between COUNT and the parenthesis.
I tried to modify the query in the database with no luck. So I recreated the whole table and chart from the information in the database and was able to retrieve my work.
Nevertheless is seems weird to me that a simple extra space can mess the whole thing around ?
These things can always surprise you with how simple stuff can break an entire query.
For instance, I'll just list a few examples:
1. From version 2.3 we've implemented a feature that you can use multiple separate DB connections for MySQL, MSSQL and PostgreSQL. For MySQL engine we are dynamically adding the accent grave ( ` ), so there's no need to use it around the table name in the query. If you use it, there's a possibility search and filters won't work.
2. The asterisk ( * ) can cause the table not to show if you have a certain security plugin installed. To get rid of the error, you need to move it to a new row, like this:
SELECT
* FROM mytable
3. Adding a semicolon at the end can cause issues with the query as well.
So, there are a lot of these little things that can cause issues. Good thing you found it, though.
If you need any further help, please feel free to reach out to us and we'll gladly help.
I created a simple table with SQL query on the default WP database
Basic SELECT COUNT, CONCATENATE, LEFT JOIN, GROUP BY
This worked perfectly.
After that I tried to add a field to my SQL query I got an error from the plugin.
Something like "cannot be null" in a red square box.
Then the page is blank and I lost everything
Hello Khoa.
Thank you for your purchase.
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.
Also, please tell me what's the table ID, so I know where to look.
Best regards.
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
Hey Khoa.
Looks like that table cannot be retrieved. Could you show me the exact query you used, so I can try and replicate the issue?
Best regards.
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
OK I checked in the database and there was a space character that create the error.
Query was:
SELECT COUNT (r.slot_id), COUNT(s.slot_id), CONCAT(DAYNAME(s.slot_date), " ", HOUR(s.slot_time_from)) as slot FROM wordpress_eaown5g98booking_slots AS s LEFT JOIN wordpress_eaown5g98booking_reservation AS r ON r.slot_id = s.slot_id GROUP BY slot
Notice the space between COUNT and the parenthesis.
I tried to modify the query in the database with no luck. So I recreated the whole table and chart from the information in the database and was able to retrieve my work.
Nevertheless is seems weird to me that a simple extra space can mess the whole thing around ?
Hi Khoa.
Great troubleshooting!
These things can always surprise you with how simple stuff can break an entire query.
For instance, I'll just list a few examples:
1. From version 2.3 we've implemented a feature that you can use multiple separate DB connections for MySQL, MSSQL and PostgreSQL. For MySQL engine we are dynamically adding the accent grave ( ` ), so there's no need to use it around the table name in the query. If you use it, there's a possibility search and filters won't work.
2. The asterisk ( * ) can cause the table not to show if you have a certain security plugin installed. To get rid of the error, you need to move it to a new row, like this:
3. Adding a semicolon at the end can cause issues with the query as well.
So, there are a lot of these little things that can cause issues. Good thing you found it, though.
If you need any further help, please feel free to reach out to us and we'll gladly help.
Best regards.
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