Check existing data in table
-
Hi Tobias,
how can I check if a value passed in a form exists in a table?
Basically, I have a page with a form that has only one field where I enter the value I want to search for in the table, and if it exists, with a shortcode, I render the table and the record on the page.
I’m not sure if my approach is correct: the form field is called ‘table_filter’; the form submits the field using the GET method; on the same page, I have a shortcode [table_filter id=3333 filter_full_cell_match=true /] that renders the table and a shortcode [test_table_cell id=3333 column=1 /] […2/] that renders the requested record.
Problem: if ‘table_filter’ is not present in table 3333, an empty table is still displayed, but I need to display a message like “Code does not exist” rather than an empty table. I have tried several functions, but I can’t verify if the value exists and therefore cannot control the feedback to provide to the user and what to display on the page. I hope you can help me.
Thank you in advance.
The topic ‘Check existing data in table’ is closed to new replies.