Hi,
thanks for your question, and sorry for the trouble.
You should not have to use a direct SQL query here. To get that entry from the wp_options database table, the WordPress PHP function get_option() would be sufficient. However, you would only get the table IDs with that, not the table names.
I therefore recommend to instead use the TablePress PHP function
$table_ids = TablePress::$model_table->load_all( true );
and then loop through this array with
$tables = array();
foreach ( $table_ids as $table_id ) {
// Load table, without table data, options, and visibility settings.
$table = TablePress::$model_table->load( $table_id, false, false );
$tables[ $table['id'] ] = $table['name'];
}
to get an array of all tables.
Regards,
Tobias
Thank you for your fast answer – this solution works like a charm and is exactly what I needed. I’m amazed. Thank you very much!
-
This reply was modified 8 years, 11 months ago by
Clickadelic.
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
Hi,
How to get table datas
I need mysql query to get particular data from tablepress in where condition
Hi,
thanks for your post, and sorry for the trouble.
Sorry, this is not possible, because TablePress does not directly use a mySQL table. Therefore, such queries are not possible.
To show a table with only some rows, you can try https://tablepress.org/extensions/row-filter/
Regards,
Tobias
This is my link http://fimqatar.com/registration/?coursename=PMP(%20PMI-USA)
i need to get particular details for course name PMP( PMI-USA)
<?php
$table_ids = TablePress::$model_table->load_all( true );
foreach ( $table_ids as $table_id ) {
// Load table, without table data, options, and visibility settings.
$table = TablePress::$model_table->load( $table_id, true, false );
$tables = $table[‘data’];
}
print_r($tables);
?>
I used this codings. I need batch schedule for dynamic course name .please tell me is there any option to satisfy my requirement.
Hi,
now that you have the table data in the $table['data'] array, you can loop through it and try to find the correct row.
Regards,
Tobias