Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    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

    Thread Starter Clickadelic

    (@clickadelic)

    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 7 years, 5 months ago by Clickadelic.
    Plugin Author TobiasBg

    (@tobiasbg)

    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

    Plugin Author TobiasBg

    (@tobiasbg)

    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 https://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.

    Plugin Author TobiasBg

    (@tobiasbg)

    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

    Thank you for your reply

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sure, no problem!

    Best wishes,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘get TablePress IDs / Names’ is closed to new replies.